vlc | branch: master | Marvin Scholz <[email protected]> | Mon Oct 29 12:42:24 
2018 +0100| [08ae5918414f3e82ebeb31faea52f7c772b4b3bd] | committer: Marvin 
Scholz

demux/adaptive: Catch all exceptions

These catches look like they intend to catch all exceptions, not just
exceptions of integer type (which is not a common exception type).
For example all exceptions derived from std::exception would not be
caught by catch(int).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08ae5918414f3e82ebeb31faea52f7c772b4b3bd
---

 modules/demux/adaptive/tools/Conversions.cpp | 2 +-
 modules/demux/adaptive/tools/Conversions.hpp | 2 +-
 modules/demux/adaptive/tools/Retrieve.cpp    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/adaptive/tools/Conversions.cpp 
b/modules/demux/adaptive/tools/Conversions.cpp
index e0e3764b20..92b6b99ef7 100644
--- a/modules/demux/adaptive/tools/Conversions.cpp
+++ b/modules/demux/adaptive/tools/Conversions.cpp
@@ -169,7 +169,7 @@ UTCTime::UTCTime(const std::string &str)
             // Failure parsing time string
             t = 0;
         }
-    } catch(int) {
+    } catch(...) {
         t = 0;
     }
 }
diff --git a/modules/demux/adaptive/tools/Conversions.hpp 
b/modules/demux/adaptive/tools/Conversions.hpp
index 4e4acee80a..1d95cfdf4e 100644
--- a/modules/demux/adaptive/tools/Conversions.hpp
+++ b/modules/demux/adaptive/tools/Conversions.hpp
@@ -57,7 +57,7 @@ template<typename T> class Integer
                 in >> value;
                 if (in.fail() || in.bad())
                     value = 0;
-            } catch (int) {
+            } catch (...) {
                 value = 0;
             }
         }
diff --git a/modules/demux/adaptive/tools/Retrieve.cpp 
b/modules/demux/adaptive/tools/Retrieve.cpp
index c14f2fcb94..a6171e5507 100644
--- a/modules/demux/adaptive/tools/Retrieve.cpp
+++ b/modules/demux/adaptive/tools/Retrieve.cpp
@@ -38,7 +38,7 @@ block_t * Retrieve::HTTP(vlc_object_t *obj, AuthStorage 
*auth, const std::string
     try
     {
         datachunk = new HTTPChunk(uri, &connManager, ID(), true);
-    } catch (int) {
+    } catch (...) {
         return NULL;
     }
 

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to