[vlc-commits] demux:mkv: fix potential NULL dereference

Steve Lhomme git at videolan.org
Fri Jan 26 10:08:49 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 26 10:03:54 2018 +0100| [314e230244ea0b69aff38657d678067d0127f847] | committer: Steve Lhomme

demux:mkv: fix potential NULL dereference

CID #1464407

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

 modules/demux/mkv/Ebml_dispatcher.hpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mkv/Ebml_dispatcher.hpp b/modules/demux/mkv/Ebml_dispatcher.hpp
index a3d39fd862..b50c655c3a 100644
--- a/modules/demux/mkv/Ebml_dispatcher.hpp
+++ b/modules/demux/mkv/Ebml_dispatcher.hpp
@@ -81,6 +81,9 @@ namespace {
 
       bool send (EbmlElement * const& element, void* payload) const
       {
+        if ( element == nullptr )
+            return false;
+
         EbmlProcessorEntry eb = EbmlProcessorEntry (
           static_cast<EbmlId const&> (*element), NULL, NULL
         );
@@ -94,7 +97,7 @@ namespace {
             _processors.begin(), cit_end, eb
         );
 
-        if (element && cit != cit_end)
+        if (cit != cit_end)
         {
           // --------------------------------------------------------------
           // normally we only need to compare the addresses of the EbmlId



More information about the vlc-commits mailing list