From: Panagiotis Issaris Date: Mon, 30 Jul 2007 13:58:17 +0000 (+0000) Subject: Handle malloc failure X-Git-Tag: v0.5~8157 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6654296c309a60ce803b7e1c70edfd3ea09ee8c0;p=platform%2Fupstream%2Flibav.git Handle malloc failure Originally committed as revision 9833 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index ab54c57..88d31d4 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -1047,6 +1047,10 @@ static int atrac3_decode_init(AVCodecContext *avctx) dsputil_init(&dsp, avctx); q->pUnits = av_mallocz(sizeof(channel_unit)*q->channels); + if (!q->pUnits) { + av_free(q->decoded_bytes_buffer); + return AVERROR(ENOMEM); + } return 0; }