diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2010-07-11 14:50:20 +0000 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2010-07-11 14:50:20 +0000 |
commit | 231745781f16bbee6af0e11459087d9272cb0853 (patch) | |
tree | 84ec3026bef37c968db90d8bdfcd4c7bc05b1f74 /libavcodec/truespeech.c | |
parent | 922189feb065bc0c7aaa87146ad4d43b6e528b7b (diff) | |
download | ffmpeg-231745781f16bbee6af0e11459087d9272cb0853.tar.gz |
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
Diffstat (limited to 'libavcodec/truespeech.c')
-rw-r--r-- | libavcodec/truespeech.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index 37fbef9dea..eafbca52d8 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -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); |