diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-09-29 05:41:54 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-09-29 12:56:45 +0200 |
commit | 8ba694548782c1821ab119c18fe02360a81c6768 (patch) | |
tree | 405d27c76a5ca75ce028d87dcc9e70528697511b /libavcodec | |
parent | 3f5095f213a02ff2b9bec08a9eddb9d2655e97bb (diff) | |
download | ffmpeg-8ba694548782c1821ab119c18fe02360a81c6768.tar.gz |
avcodec/utils: Fix off by 1 error causing unneeded allocation in ff_fast_malloc()
Reviewed-by: Benoit Fouet <benoit.fouet@free.fr>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b27f918105..9eb2b5b6ed 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -122,7 +122,7 @@ static void *avformat_mutex; static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size, int zero_realloc) { void **p = ptr; - if (min_size < *size) + if (min_size <= *size && *p) return 0; min_size = FFMAX(17 * min_size / 16 + 32, min_size); av_free(*p); |