diff wma.c @ 5086:a10ebd496bd9 libavcodec

sanity checks (should prevent hypothetical div by zero issue) should fix sf bug #1547313
author michael
date Wed, 30 May 2007 23:06:37 +0000
parents 99d9dd34903b
children 04a241c308e8
line wrap: on
line diff
--- a/wma.c	Wed May 30 21:38:57 2007 +0000
+++ b/wma.c	Wed May 30 23:06:37 2007 +0000
@@ -72,6 +72,11 @@
     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;