From 47b777ceed470104fb4e6325d5ac1bddbb4752c8 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 30 May 2007 23:06:37 +0000 Subject: sanity checks (should prevent hypothetical div by zero issue) should fix sf bug #1547313 Originally committed as revision 9164 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/wma.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec/wma.c') diff --git a/libavcodec/wma.c b/libavcodec/wma.c index 2241a07a0e..1f1495e6ef 100644 --- a/libavcodec/wma.c +++ b/libavcodec/wma.c @@ -72,6 +72,11 @@ int ff_wma_init(AVCodecContext * avctx, int flags2) int sample_rate1; int coef_vlc_table; + if( avctx->sample_rate<=0 || avctx->sample_rate>50000 + || avctx->channels<=0 || avctx->channels>8 + || avctx->bit_rate<=0) + return -1; + s->sample_rate = avctx->sample_rate; s->nb_channels = avctx->channels; s->bit_rate = avctx->bit_rate; -- cgit v1.2.3