From 6654296c309a60ce803b7e1c70edfd3ea09ee8c0 Mon Sep 17 00:00:00 2001 From: Panagiotis Issaris Date: Mon, 30 Jul 2007 13:58:17 +0000 Subject: Handle malloc failure Originally committed as revision 9833 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/atrac3.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavcodec/atrac3.c') diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index ab54c5708a..88d31d4ab1 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; } -- cgit v1.2.3