[FFmpeg-devel] [PATCH] mkv 0-byte integer parsing

Sebastian Hagen sebastian_hagen
Tue Sep 7 20:14:41 CEST 2010

On 2010-09-05 17:51, Reimar D?ffinger wrote:
> AFAIK this makes it also accept negative size (and it seems it
Good catch about the negative size possibility. I didn't notice that it 
takes the size as a signed value.

> Attached patch adds a length check for that case (this is independant
> of this patch though).

*reads patch*
> +        [EBML_UINT]  = 4,
Please don't. According to the mkv specs[1], those can go up to 8 bytes, 
and afaik you're allowed to make them that big even if you don't need 
the full 8 bytes to store whatever value you have. Not allowing for the 
full 8 byte maximum length would break parsing of valid mkv files.

Sebastian Hagen

[1] <http://www.matroska.org/technical/specs/index.html>

More information about the ffmpeg-devel mailing list