[FFmpeg-devel] stsz overflow

Frank Barchard fbarchard
Wed Aug 26 00:44:26 CEST 2009

On Tue, Aug 25, 2009 at 2:48 PM, Alex Converse <alex.converse at gmail.com>wrote:

> For a 32-bit field size the actual limit on the number of entries is
> (2^32-1-4-4-1-3-4-4)/4 = 1073741818 based on a 4 byte field specifying
> atom size in bytes and subtracting off fixed headers. This generalises
> to 16-bit field 2147483637, for an 8-bit field 4294967275, and for a
> 4-bit field it saturates to 4294967295. Is there anything else that
> could impose an absolute ceiling on these values? Or are we not going
> to worry about legal but insanely long sample sizes tables?

I dont think we should try to support 'insanely' long stsz tables.
If you make the if() statement too complicated, it'll be error prone to

More information about the ffmpeg-devel mailing list