Commit 4df0bba2 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf
Browse files

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's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 81c850e4
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment