Only check frame size if the header is valid.

Originally committed as revision 21439 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Justin Ruggles 2010-01-24 23:55:33 +00:00
parent b52fcba9cd
commit 008f872f61
1 changed files with 1 additions and 1 deletions

View File

@ -1237,7 +1237,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
err = parse_frame_header(s);
/* check that reported frame size fits in input buffer */
if(s->frame_size > buf_size) {
if(!err && s->frame_size > buf_size) {
av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
err = AAC_AC3_PARSE_ERROR_FRAME_SIZE;
}