Commit 0a7c36af authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

revert aligned realloc() changesm this should be identical to r5784

Originally committed as revision 6008 to svn://
parent 2287c100
......@@ -50,7 +50,7 @@ void *av_malloc(unsigned int size)
/* let's disallow possible ambiguous cases */
if(size > (INT_MAX-16) || !size)
if(size > (INT_MAX-16) )
return NULL;
......@@ -101,26 +101,22 @@ void *av_malloc(unsigned int size)
void *av_realloc(void *ptr, unsigned int size)
void *ptr2;
int diff;
/* let's disallow possible ambiguous cases */
if(size > (INT_MAX-16) )
return NULL;
ptr= realloc(ptr, size);
assert(((int)((void*)0)&15) == 0); //for the null pointer pedants
return ptr;
//FIXME this isn't aligned correctly, though it probably isn't needed
if(!ptr) return av_malloc(size);
diff= ((char*)ptr)[-1];
return realloc(ptr - diff, size + diff) + diff;
return realloc(ptr, size);
ptr2= av_malloc(size);
if(ptr && ptr2)
memcpy(ptr2, ptr, size);
if(ptr2 || !size)
return ptr2;
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