changeset 5423:2c98d63a8956 libavcodec

Handle malloc failure
author takis
date Mon, 30 Jul 2007 13:58:17 +0000
parents ad384eda0cb7
children 07844149dfa9
files atrac3.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/atrac3.c	Mon Jul 30 02:05:16 2007 +0000
+++ b/atrac3.c	Mon Jul 30 13:58:17 2007 +0000
@@ -1047,6 +1047,10 @@
     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;
 }