[FFmpeg-devel] [PATCH] mem: workaround alloc bug in OSX

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Feb 5 19:17:43 CET 2013


On 5 Feb 2013, at 17:43, Michael Niedermayer <michaelni at gmx.at> wrote:
> Fixes Ticket2229
> 
> Untested
> 
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
> libavutil/mem.c |    1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/libavutil/mem.c b/libavutil/mem.c
> index 250b5f7..e3572cd 100644
> --- a/libavutil/mem.c
> +++ b/libavutil/mem.c
> @@ -120,6 +120,7 @@ void *av_malloc(size_t size)
>      * BTW, malloc seems to do 8-byte alignment by default here.
>      */
> #else
> +    if (size) //OS X has a broken malloc implementation
>     ptr = malloc(size);


I am fairly sure we had this before, then I think we made sure to never allocate anything of size 0 and thus removed it.
I think we should make sure we're not repeating this back and forth forever, it's not a particularly good use of time.
But otherwise I think it is ok.


More information about the ffmpeg-devel mailing list