[Ffmpeg-devel] [PATCH] from DivX, Part 1: cosmectic changes

Steve Lhomme steve.lhomme
Sat Dec 17 02:20:38 CET 2005

>>The type of a sizeof() expression is size_t, which is unsigned.  Hence
>>sizeof(foo) + x < x is impossible, unless the addition overflows.
> yes, maybe looking at the next line clarifies the meaning behind this
> d = av_malloc(sizeof(DynBuffer) + io_buffer_size);
> if it overflows, you will have a too small buffer ...

The question is : will it overflow on a 32 bits system ?
There are other example of such tests that I replaced with asserts.

More information about the ffmpeg-devel mailing list