vlc | branch: master | Filip Roséen <[email protected]> | Fri Mar  4 17:03:59 2016 
+0100| [4df0bba2679b306af75abf5e484216e50959886d] | committer: Jean-Baptiste 
Kempf

mkv: added warning regarding undefined-behavior

The workaround currently present in the codebase is undefined-behavior
since the dynamic type of the object in question is not the one used in
the `static_cast`.

In short nothing guarantees that the vtable for the different types look
the same, and as such this is very dangerous.

We should probably supply a patch upstream if the bug is still present
in their code.

Signed-off-by: Jean-Baptiste Kempf <[email protected]>

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

 modules/demux/mkv/Ebml_parser.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mkv/Ebml_parser.cpp 
b/modules/demux/mkv/Ebml_parser.cpp
index 0561ad1..5a5f18b 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -208,7 +208,7 @@ EbmlElement *EbmlParser::Get( int n_call )
             if( !mb_keep )
             {
                 if( MKV_IS_ID( p_prev, KaxBlockVirtual ) )
-                    static_cast<KaxBlockVirtualWorkaround*>(p_prev)->Fix();
+                    static_cast<KaxBlockVirtualWorkaround*>(p_prev)->Fix(); // 
!! WARNING : TODO !! this is undefined-behavior
                 delete p_prev;
             }
             mb_keep = false;

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

Reply via email to