mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-19 05:40:56 +00:00
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>
This commit is contained in:
parent
3f5095f213
commit
8ba6945487
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user