[FFmpeg-devel] [PATCH] mem: prefer SIZE_MAX over INT_MAX in av_malloc() and av_realloc() checks

Stefano Sabatini stefano.sabatini-lala at poste.it
Thu May 19 09:00:54 CEST 2011

On date Thursday 2011-05-19 08:20:11 +0200, Reimar Döffinger encoded:
> On 19 May 2011, at 06:08, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Thu, May 19, 2011 at 12:07:27AM +0200, Stefano Sabatini wrote:
> >> Now the functions accepts size_t size rather than int values, so using
> >> size_t is more correct.
> > 
> > 2gb should be enough for everyone ;)
> > seriously i think allocating more (currently) is likely a bug
> > maybe in a few years rawvideo frames will need but until then its
> > safer to not extend this limit
> > thats IMHO
> I agree. I also prefer for behaviour to differ as little as possible between 32 and 64 bit systems.

buffers are used not only for frames, check #185.

Also MAX_INT is not fixed as well, if you want to avoid 32/64-bit
system difference you should rather use a define (FF_MAX_MALLOC_SIZE).
FFmpeg = Freak and Fundamentalist Mega Plastic Epic Guru

More information about the ffmpeg-devel mailing list