return error if buf_size is too small

Originally committed as revision 12981 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2008-04-26 12:39:45 +00:00
parent dfcd6d91fe
commit a82dcdffb2
1 changed files with 3 additions and 4 deletions

View File

@ -2570,11 +2570,10 @@ static int decode_frame_mp3on4(AVCodecContext * avctx,
len = buf_size;
*data_size = 0;
// Discard too short frames
if (buf_size < HEADER_SIZE) {
*data_size = 0;
return buf_size;
}
if (buf_size < HEADER_SIZE)
return -1;
// If only one decoder interleave is not needed
outptr = s->frames == 1 ? out_samples : decoded_buf;