aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/wma.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-06-30 21:30:28 +0300
committerMartin Storsjö <martin@martin.st>2012-07-01 15:51:26 +0300
commit710bd8a33e9c183ded4a61d742d404d8d5d838ea (patch)
treef5acd99bde020addc649745ba74fc8418465a546 /libavcodec/wma.c
parent889c1ec4cc064313092bc43a8a3a05aac9799e61 (diff)
downloadffmpeg-710bd8a33e9c183ded4a61d742d404d8d5d838ea.tar.gz
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@martin.st>
Diffstat (limited to 'libavcodec/wma.c')
-rw-r--r--libavcodec/wma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index 007653ffec..b61228b94b 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;