[vlc-devel] [PATCH] Fix crash in invalid MKV files

Denis Charmet typx at dinauz.org
Wed Nov 23 23:45:46 CET 2011


Hi,
Le mercredi 23 novembre 2011 à 09:56:27, Cheng Sun a écrit :
> This patch fixes a crash in invalid MKV files.
> 
> VirtualFromSegments can crash if the std::vector passed in is empty,
> which can happen in corrupted files. This is just a simple check for
> this  case, making it fail elegantly rather than crashing.
> 
> (Patch attached rather than inline, sorry for inconvenience)

Thank you for reporting and for your fix. You patch is 100% valid and
should be applied.

But the real problem was elsewhere, as the Segment Info block is 
mandatory the parser assumes it will be present and it always keeps the
first segment found.

The patch I've sent should prevent that anyway with a more explicit
error.

Good work!

Regards,
-- 
TypX
Le mauvais esprit est un art de vivre



More information about the vlc-devel mailing list