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:
parent
9ea81fe95e
commit
bc976e5793
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user