Commit f8db8107 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/utils: Assert that the pointer is set when size is in ff_fast_malloc()

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 59a07df0
......@@ -127,8 +127,10 @@ static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size,
void *val;
memcpy(&val, ptr, sizeof(val));
if (min_size <= *size && val)
if (min_size <= *size) {
av_assert0(val || !min_size);
return 0;
}
min_size = FFMAX(min_size + min_size / 16 + 32, min_size);
av_freep(ptr);
val = zero_realloc ? av_mallocz(min_size) : av_malloc(min_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment