diff options
author | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2017-12-30 16:38:33 +0300 |
---|---|---|
committer | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2018-01-02 00:30:22 +0300 |
commit | 21b5990da461e4f83cf53994715ed42e22cce9e0 (patch) | |
tree | dd5988a0cce72b6a1a09344a0ea6cf23b2ce481f /libavutil | |
parent | 1112ba012df38d486694154b03f5007341f43b24 (diff) |
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.
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c index 79e8b597f1..0729e1dd50 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -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); |