mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
lavu/mem: Do not realloc in av_fast_realloc() if size == min_size.
This can avoid OOM for min_size close to FFmpeg's arbitrary alloc limits.
This commit is contained in:
parent
1112ba012d
commit
21b5990da4
@ -463,7 +463,7 @@ void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
|
||||
|
||||
void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
|
||||
{
|
||||
if (min_size < *size)
|
||||
if (min_size <= *size)
|
||||
return ptr;
|
||||
|
||||
min_size = FFMAX(min_size + min_size / 16 + 32, min_size);
|
||||
|
Loading…
Reference in New Issue
Block a user