提交 d5f121e2 编写于 作者: M Michael Niedermayer

10l (gcc 2.95 fix)

Originally committed as revision 3827 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 1f3f9507
...@@ -45,13 +45,13 @@ ...@@ -45,13 +45,13 @@
void *av_malloc(unsigned int size) void *av_malloc(unsigned int size)
{ {
void *ptr; void *ptr;
int diff;
/* lets disallow possible ambiguous cases */ /* lets disallow possible ambiguous cases */
if(size > INT_MAX) if(size > INT_MAX)
return NULL; return NULL;
#ifdef MEMALIGN_HACK #ifdef MEMALIGN_HACK
int diff;
ptr = malloc(size+16+1); ptr = malloc(size+16+1);
diff= ((-(int)ptr - 1)&15) + 1; diff= ((-(int)ptr - 1)&15) + 1;
ptr += diff; ptr += diff;
...@@ -97,13 +97,13 @@ void *av_malloc(unsigned int size) ...@@ -97,13 +97,13 @@ void *av_malloc(unsigned int size)
*/ */
void *av_realloc(void *ptr, unsigned int size) void *av_realloc(void *ptr, unsigned int size)
{ {
int diff;
/* lets disallow possible ambiguous cases */ /* lets disallow possible ambiguous cases */
if(size > INT_MAX) if(size > INT_MAX)
return NULL; return NULL;
#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;
if(!ptr) return av_malloc(size); if(!ptr) return av_malloc(size);
diff= ((char*)ptr)[-1]; diff= ((char*)ptr)[-1];
return realloc(ptr - diff, size + diff) + diff; return realloc(ptr - diff, size + diff) + diff;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册