check alac EOF marker

Patch by Matthieu Castet castet matthieu free fr

Originally committed as revision 12891 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Matthieu Castet 2008-04-18 08:58:18 +00:00 committed by Benoit Fouet
parent 2003d3da1a
commit e5ab737950
1 changed files with 5 additions and 0 deletions

View File

@ -548,6 +548,8 @@ static int alac_decode_frame(AVCodecContext *avctx,
interlacing_shift = 0;
interlacing_leftweight = 0;
}
if (get_bits(&alac->gb, 3) != 7)
av_log(avctx, AV_LOG_ERROR, "Error : Wrong End Of Frame\n");
switch(alac->setinfo_sample_size) {
case 16:
@ -577,6 +579,9 @@ static int alac_decode_frame(AVCodecContext *avctx,
break;
}
if (input_buffer_size * 8 - get_bits_count(&alac->gb) > 8)
av_log(avctx, AV_LOG_ERROR, "Error : %d bits left\n", input_buffer_size * 8 - get_bits_count(&alac->gb));
return input_buffer_size;
}