Browse code

wmapro: prevent division by zero when sample rate is unspecified

This fixes Bugzilla #327:

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>

Sean McGovern authored on 2012/08/03 04:37:28
Showing 1 changed files
... ...
@@ -335,6 +335,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
335 335
         return AVERROR_INVALIDDATA;
336 336
     }
337 337
 
338
+    if (s->avctx->sample_rate <= 0) {
339
+        av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
340
+        return AVERROR_INVALIDDATA;
341
+    }
342
+
338 343
     s->num_channels = avctx->channels;
339 344
 
340 345
     if (s->num_channels < 0) {