[FFmpeg-devel] [PATCH][RFC]lavu/mem: Do not realloc in av_fast_alloc() if size == min_size

Derek Buitenhuis derek.buitenhuis at gmail.com
Sat Dec 30 18:24:58 EET 2017


On 12/30/2017 1:44 PM, Carl Eugen Hoyos wrote:
> FFmpeg has an arbitrary allocation limit (2G iirc), av_fast_realloc()
> increases the allocation even if the requested is equal the already
> allocated size. I believe this can lead to unnecessary OOM (no
> testcase) if the requested (and already allocated) size is close to
> our limit.
> Additionally, this avoids an over-allocation for the mov stts patch I just sent.
> Attached patch changes the behaviour introduced 15 years ago.

I'm not aware of such a limit within the libraries (there is no allocation
tracking)?

The change itself looks like it is correct to me, unless there is some special
reason it was < instead of <= before.

- Derek


More information about the ffmpeg-devel mailing list