[FFmpeg-devel] [PATCH] oggparsevorbis: use av_realloc consistently

Paweł Hajdan phajdan at google.com
Tue Jan 29 12:45:51 CET 2013

On Fri, Jan 11, 2013 at 9:12 PM, Michael Niedermayer <michaelni at gmx.at>wrote:

> yes, we need to do something about this, is there some way by which
> debugallocation can be detected ?

I'm not aware of such mechanism. By the way, it seems wrong to do a
different thing depending on whether debugallocation is present or not,
since then you'd be debugging a different program.

> It would also be interresting to know how many cases of
> posix_memalign + realloc() exist in the code.

At least counting what's covered by "make fate", I only needed to make one
other change:

> ATM i see as solutions
> A. detect debugallocation and do a malloc+memcpy+free for av_realloc
> B. change the code to never mix av_malloc* and av_realloc
> C. ignore it and declare debugallocation unsupported
> D. mark memory so the used allocator can be detected
> B is only practical if there are very few such cases

It seems B would be quite practical - just this patch and the one linked
above. There might be some more cases, but so far these two patches fix
things covered by Chromium test suite and "make fate".

More information about the ffmpeg-devel mailing list