[FFmpeg-soc] [soc]: r2697 - aac/aac.c
superdump
subversion at mplayerhq.hu
Sun Jul 6 12:40:54 CEST 2008
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;
}
More information about the FFmpeg-soc
mailing list