mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
mem: fix memalign hack av_realloc()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commitfc11927890
) Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit5ae87280e2
) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c603cf5170
commit
36e4be0a0a
@ -113,7 +113,9 @@ void *av_realloc(void *ptr, unsigned int 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);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user