1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-03 14:32:16 +02:00

avcodec/utils: Fix potential overflow in overallocation code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-07-11 22:46:44 +02:00
parent 9ea81fe95e
commit bc976e5793

View File

@ -127,7 +127,7 @@ static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size,
void **p = ptr;
if (min_size <= *size && *p)
return 0;
min_size = FFMAX(17 * min_size / 16 + 32, min_size);
min_size = FFMAX(min_size + min_size / 16 + 32, min_size);
av_free(*p);
*p = zero_realloc ? av_mallocz(min_size) : av_malloc(min_size);
if (!*p)