Commit fc119278 authored by Michael Niedermayer's avatar Michael Niedermayer

mem: fix memalign hack av_realloc()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 96bc6485
......@@ -137,7 +137,9 @@ void *av_realloc(void *ptr, size_t size)
//FIXME this isn't aligned correctly, though it probably isn't needed
if(!ptr) return av_malloc(size);
diff= ((char*)ptr)[-1];
return (char*)realloc((char*)ptr - diff, size + diff) + diff;
ptr= realloc((char*)ptr - diff, size + diff);
if(ptr) ptr = (char*)ptr + diff;
return ptr;
#else
return realloc(ptr, size + !size);
#endif
......
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