diff --git a/libavutil/mem.c b/libavutil/mem.c index 18fe28b7ce..7ffd6cba9b 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 }