aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/wma.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-05-30 23:06:37 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-05-30 23:06:37 +0000
commit47b777ceed470104fb4e6325d5ac1bddbb4752c8 (patch)
treebfb0ef80be2773589f1f0a13cdbfc55a9d579124 /libavcodec/wma.c
parent61d49d122cd33a215e41fbdb763bea23486eb7af (diff)
downloadffmpeg-47b777ceed470104fb4e6325d5ac1bddbb4752c8.tar.gz
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
Diffstat (limited to 'libavcodec/wma.c')
-rw-r--r--libavcodec/wma.c5
1 files changed, 5 insertions, 0 deletions
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;