wmapro: prevent division by zero when sample rate is unspecified

This fixes Bugzilla #327:

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
(cherry picked from commit 3680b2435101a5de56821718a71c828320d535a0)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Sean McGovern 2012-08-02 15:37:28 -04:00 committed by Anton Khirnov
parent 3c55bf1201
commit a2d4d9f4fb

View File

@ -330,6 +330,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) {