Commit 710bd8a3 authored by Martin Storsjö's avatar 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: 's avatarMartin Storsjö <martin@martin.st>
parent 889c1ec4
...@@ -78,7 +78,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2) ...@@ -78,7 +78,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
int coef_vlc_table; int coef_vlc_table;
if ( avctx->sample_rate <= 0 || avctx->sample_rate > 50000 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) || avctx->bit_rate <= 0)
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment