mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-22 15:23:42 +00:00
mem: fix memalign hack av_realloc()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc11927890
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
7d02df7036
commit
5ae87280e2
@ -137,7 +137,9 @@ void *av_realloc(void *ptr, size_t size)
|
|||||||
//FIXME this isn't aligned correctly, though it probably isn't needed
|
//FIXME this isn't aligned correctly, though it probably isn't needed
|
||||||
if(!ptr) return av_malloc(size);
|
if(!ptr) return av_malloc(size);
|
||||||
diff= ((char*)ptr)[-1];
|
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
|
#else
|
||||||
return realloc(ptr, size + !size);
|
return realloc(ptr, size + !size);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user