Commit 76bb7660 authored by michael's avatar michael

realloc(NULL) fix


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3351 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent bea1489f
...@@ -95,7 +95,9 @@ void *av_realloc(void *ptr, unsigned int size) ...@@ -95,7 +95,9 @@ void *av_realloc(void *ptr, unsigned int size)
{ {
#ifdef MEMALIGN_HACK #ifdef MEMALIGN_HACK
//FIXME this isnt aligned correctly though it probably isnt needed //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; return realloc(ptr - diff, size + diff) + diff;
#else #else
return realloc(ptr, size); return realloc(ptr, size);
......
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