[Ffmpeg-devel] Fix for overflow issue in mpegvideo.c

Martin Boehme boehme
Tue Jul 26 13:19:23 CEST 2005

Michael Niedermayer wrote:
> On Monday 25 July 2005 17:23, Martin Boehme wrote:
>>the attached patch fixes an overflow issue I was getting for
>>(overconservatively) large buffer sizes and large picture heights, i.e.
>>buf_size=2.5 MB and end_y=1024. I'm aware this buf_size is _much_ too
>>large (being lazy, I allocate enough buffer for a complete uncompressed
>>image so I _know_ it will be enough)... OTOH, ffmpeg's (static) buffer
>>size (256 KB) is already within an order of magnitude of the "critical"
> applied
> btw i dont think buf_size=width*height*1.5 is enough, try random 255/0 sample 
> values at qp=1, btw2 if you actually try this i would be interrested in the 
> results

Tried it, with MPEG-4 I get about width*height*3.63 bytes per frame... 
ouch. So I now use width*height*4... ;-) under the assumption that the 
above is just about the worst case... (BTW, is that true?)


Martin B?hme
Inst. f. Neuro- and Bioinformatics
Ratzeburger Allee 160, D-23538 Luebeck
Phone: +49 451 500 5514
Fax:   +49 451 500 5502
boehme at inb.uni-luebeck.de

More information about the ffmpeg-devel mailing list