mirror of https://git.ffmpeg.org/ffmpeg.git
mem: fix memalign hack av_realloc()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
96bc6485bc
commit
fc11927890
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue