Browse Source

wmapro: prevent division by zero when sample rate is unspecified

This fixes Bugzilla #327:

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
tags/n1.0
Sean McGovern Ronald S. Bultje 13 years ago
parent
commit
3693608023
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/wmaprodec.c

+ 5
- 0
libavcodec/wmaprodec.c View File

@@ -340,6 +340,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}

if (s->avctx->sample_rate <= 0) {
av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
return AVERROR_INVALIDDATA;
}

s->num_channels = avctx->channels;

if (s->num_channels < 0) {


Loading…
Cancel
Save