[FFmpeg-devel] [PATCH] av_malloc() workaround for QNX platform

Mike Gorchak mike.gorchak.qnx at gmail.com
Thu Feb 7 21:57:16 CET 2013

> 0x0000FE0 + 0x00000020
> is
> 0x1000 not 0x10000

Sorry for typo.

> and you stated above "32 bytes aligned and size also 32 bytes"
> that makes an allocation of 64bytes due to
> "ptr = malloc(size + ALIGN);"
> thus 0x1000 up to 0x101F is allocated and there are 32bytes available
> at the pointer as requested

I agree this code is correct, but anyway something trashing the heap
when this code is active. Maybe code somewhere has va_malloc() and
corresponding free() instead of va_free(), but this situation is hard
to check. I've checked vice versa situation when malloc()/va_free() is
used, and have not found any cases. Memory heap corruption is 100%
reproducible using H.264 codec, but when posix_memalign() is used, all
goes fine, because free() and va_free() are the same.

More information about the ffmpeg-devel mailing list