aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authoravcoder <ffmpeg@gmail.com>2008-02-14 08:16:07 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2008-02-14 08:16:07 +0000
commit90d30570d893ce3ee5bc5e86254b9a89035f2c47 (patch)
tree487b91c9240d55b716a32d74205485d828575bfb /libavutil
parent7eeebcc5deaf83f688585fdc2f5525f45b552e05 (diff)
downloadffmpeg-90d30570d893ce3ee5bc5e86254b9a89035f2c47.tar.gz
Avoid void*-arithmetic.
Patch by mvplayer: ffmpeg gmail com Originally committed as revision 11932 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/mem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c
index a91ac4a07b..2444759681 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -55,7 +55,7 @@ void *av_malloc(unsigned int size)
if(!ptr)
return ptr;
diff= ((-(long)ptr - 1)&15) + 1;
- ptr += diff;
+ ptr = (char*)ptr + diff;
((char*)ptr)[-1]= diff;
#elif defined (HAVE_MEMALIGN)
ptr = memalign(16,size);
@@ -105,7 +105,7 @@ void *av_realloc(void *ptr, unsigned int size)
//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 (char*)realloc((char*)ptr - diff, size + diff) + diff;
#else
return realloc(ptr, size);
#endif
@@ -116,7 +116,7 @@ void av_free(void *ptr)
/* XXX: this test should not be needed on most libcs */
if (ptr)
#ifdef CONFIG_MEMALIGN_HACK
- free(ptr - ((char*)ptr)[-1]);
+ free((char*)ptr - ((char*)ptr)[-1]);
#else
free(ptr);
#endif