1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Do not try to decode less than one frame of data in TrueSpeech decoder.

This should solve issue 2085.

Originally committed as revision 24197 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Kostya Shishkov 2010-07-11 14:50:20 +00:00
parent 922189feb0
commit 231745781f

View File

@ -347,6 +347,11 @@ static int truespeech_decode_frame(AVCodecContext *avctx,
if (!buf_size)
return 0;
if (buf_size < 32) {
av_log(avctx, AV_LOG_ERROR,
"Too small input buffer (%d bytes), need at least 32 bytes\n", buf_size);
return -1;
}
iterations = FFMIN(buf_size / 32, *data_size / 480);
for(j = 0; j < iterations; j++) {
truespeech_read_frame(c, buf + consumed);