[SCM] libav/experimental: Handle malloc failure

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:04:25 UTC 2013


The following commit has been merged in the experimental branch:
commit 6654296c309a60ce803b7e1c70edfd3ea09ee8c0
Author: Panagiotis Issaris <takis.issaris at uhasselt.be>
Date:   Mon Jul 30 13:58:17 2007 +0000

    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;
 }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list