[FFmpeg-cvslog] Avoid pointless check before calling free
Clément Bœsch
git
Fri Feb 4 03:37:02 CET 2011
ffmpeg | branch: master | Cl?ment B?sch <ubitux at gmail.com> | Thu Feb 3 01:40:35 2011 +0100| [0c8eb72ec5183909d87d8bba5c3b17337635c02a] | committer: Michael Niedermayer
Avoid pointless check before calling free
Signed-off-by: Mans Rullgard <mans at mansr.com>
(cherry picked from commit dc75d6dbf2af3c03b33d3159e1dadccf22c076ea)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c8eb72ec5183909d87d8bba5c3b17337635c02a
---
libavutil/mem.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/libavutil/mem.c b/libavutil/mem.c
index 18fe28b..7ffd6cb 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -138,12 +138,11 @@ void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
void av_free(void *ptr)
{
- /* XXX: this test should not be needed on most libcs */
- if (ptr)
#if CONFIG_MEMALIGN_HACK
+ if (ptr)
free((char*)ptr - ((char*)ptr)[-1]);
#else
- free(ptr);
+ free(ptr);
#endif
}
More information about the ffmpeg-cvslog
mailing list