[FFmpeg-cvslog] twinvq: validate that channels is not <= 0

Justin Ruggles git at videolan.org
Fri Nov 2 14:32:43 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Tue Oct 23 13:15:24 2012 -0400| [8cc72ce5a0d8ab6bc88d28cf55cd62674240121d] | committer: Justin Ruggles

twinvq: validate that channels is not <= 0

This could occur due to integer overflow when reading the channel count from
the extradata.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8cc72ce5a0d8ab6bc88d28cf55cd62674240121d
---

 libavcodec/twinvq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c
index d009196..50ee626 100644
--- a/libavcodec/twinvq.c
+++ b/libavcodec/twinvq.c
@@ -1126,7 +1126,7 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
     default: avctx->sample_rate = isampf * 1000; break;
     }
 
-    if (avctx->channels > CHANNELS_MAX) {
+    if (avctx->channels <= 0 || avctx->channels > CHANNELS_MAX) {
         av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %i\n",
                avctx->channels);
         return -1;



More information about the ffmpeg-cvslog mailing list