[FFmpeg-devel] [PATCH] avcodec/vp56: use av_reallocp_array() and check if allocation fail

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Sep 9 18:36:35 CEST 2013


Paul B Mahol <onemda <at> gmail.com> writes:

> +    av_reallocp_array(&s->above_blocks, 4*s->mb_width+6,
> +                      sizeof(*s->above_blocks));
> +    av_reallocp_array(&s->macroblocks, s->mb_width*s->mb_height,
> +                      sizeof(*s->macroblocks));
>      av_free(s->edge_emu_buffer_alloc);
>      s->edge_emu_buffer_alloc = av_malloc(16*stride);
> +    if (!s->above_blocks || !s->macroblocks || !s->edge_emu_buffer_alloc)
> +        return AVERROR(ENOMEM);

I don't know how likely it is (possibly even impossible) but 
you could consider fixing the possible memleak.

Carl Eugen



More information about the ffmpeg-devel mailing list