[FFmpeg-cvslog] wma: Lower the maximum number of channels to 2

Martin Storsjö git at videolan.org
Sun Jul 1 22:48:56 CEST 2012


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sat Jun 30 21:30:28 2012 +0300| [710bd8a33e9c183ded4a61d742d404d8d5d838ea] | committer: Martin Storsjö

wma: Lower the maximum number of channels to 2

ff_wma_init is used only by wmadec and wmaenc, and neither of them
can handle more than 2 channels.

This fixes crashes with invalid files.

Based on patch by Piotr Bandurski and Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin at martin.st>

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

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

diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index 007653f..b61228b 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -78,7 +78,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
     int coef_vlc_table;
 
     if (   avctx->sample_rate <= 0 || avctx->sample_rate > 50000
-        || avctx->channels    <= 0 || avctx->channels    > 8
+        || avctx->channels    <= 0 || avctx->channels    > 2
         || avctx->bit_rate    <= 0)
         return -1;
 



More information about the ffmpeg-cvslog mailing list