Author: superdump
Date: Sun Jul  6 12:40:54 2008
New Revision: 2697

Log:
Prevent memleak if allocation fails


Modified:
   aac/aac.c

Modified: aac/aac.c
==============================================================================
--- aac/aac.c   (original)
+++ aac/aac.c   Sun Jul  6 12:40:54 2008
@@ -469,7 +469,7 @@ static int output_configure(AACContext *
     AVCodecContext *avctx = ac->avccontext;
     ProgramConfig * pcs = &ac->pcs;
     int i, j, channels = 0;
-    float a, b;
+    float a, b, *ilo_tmp;
     ChannelElement *mixdown[3] = { NULL, NULL, NULL };
 
     static const float mixdowncoeff[4] = {
@@ -560,7 +560,10 @@ static int output_configure(AACContext *
     }
 
     avctx->channels = channels;
+    ilo_tmp = ac->interleaved_output;
     ac->interleaved_output = av_realloc(ac->interleaved_output, channels * 
1024 * sizeof(float));
+    if(!ac->interleaved_output)
+        av_freep(ilo_tmp);
     return ac->interleaved_output ? 0 : -1;
 }
 
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to