[FFmpeg-devel] [PATCH]Check for OOM in TTA decoder

Nicolas George nicolas.george at normalesup.org
Wed Apr 27 09:11:06 CEST 2011


L'octidi 8 floréal, an CCXIX, Carl Eugen Hoyos a écrit :
>          s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels);
>          s->ch_ctx = av_malloc(avctx->channels * sizeof(*s->ch_ctx));
> -        if (!s->ch_ctx)
> +        if (!s->decode_buffer || !s->ch_ctx)
>              return AVERROR(ENOMEM);

Doesn't that make a memleak if one of the malloc succeeds but the other
fails?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110427/1b501e01/attachment.asc>


More information about the ffmpeg-devel mailing list