diff options
author | Sean McGovern <gseanmcg@gmail.com> | 2012-08-02 15:37:28 -0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-10-18 07:41:21 +0200 |
commit | a2d4d9f4fbe13cb259f06fb907a056b6f3dd2d15 (patch) | |
tree | e70b15f56d77d7b194faf65af2ab3fe64b6e889d | |
parent | 3c55bf1201ac75c5e46b03e3e077031f755f85d0 (diff) | |
download | ffmpeg-a2d4d9f4fbe13cb259f06fb907a056b6f3dd2d15.tar.gz |
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>
-rw-r--r-- | libavcodec/wmaprodec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 3b8c2c8676..9804cc28e7 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -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) { |