1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

realloc(NULL) fix

Originally committed as revision 3351 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2004-07-27 11:09:41 +00:00
parent e071139a96
commit c07a22fb9f

View File

@ -95,7 +95,9 @@ void *av_realloc(void *ptr, unsigned int size)
{
#ifdef MEMALIGN_HACK
//FIXME this isnt aligned correctly though it probably isnt needed
int diff= ptr ? ((char*)ptr)[-1] : 0;
int diff;
if(!ptr) return av_malloc(size);
diff= ((char*)ptr)[-1];
return realloc(ptr - diff, size + diff) + diff;
#else
return realloc(ptr, size);