[FFmpeg-devel] size=0, but av_malloc(1)

Ronald S. Bultje rsbultje at gmail.com
Wed Mar 23 13:32:28 CET 2016


Hi,

On Wed, Mar 23, 2016 at 2:43 AM, Chris Cunningham <chcunningham at chromium.org
> wrote:

> Hey Group,
>
> I'm seeing an interesting pattern [0][1] where we allocate 1 byte in places
> where I would expect no allocation to be necessary. Why is this being done?
>
> [0] https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/mem.c#L136
> [1]
>
> https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/oggparsevorbis.c#L286


On certain versions of Mac, posix_memalign() with align=32 returns
corrupted addresses [1]. This is a workaround for that bug.

Ronald

[1] http://lists.apple.com/archives/darwin-kernel/2011/Apr/msg00017.html


More information about the ffmpeg-devel mailing list