Handle malloc failure

Originally committed as revision 9833 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Panagiotis Issaris 2007-07-30 13:58:17 +00:00
parent bffcf2ebbf
commit 6654296c30
1 changed files with 4 additions and 0 deletions

View File

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