diff options
author | Sean McGovern <gseanmcg@gmail.com> | 2012-08-02 15:37:28 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-08-03 12:04:47 -0700 |
commit | 36936080239ba9e162f9f5d0f722ce579cb606cf (patch) | |
tree | 2b4dc3e8f61c54ce3a9eeb50ec98c983e0515e92 /libavcodec | |
parent | 7191e1c49037f0ddc25515938ad379185ddd0c9c (diff) | |
download | ffmpeg-36936080239ba9e162f9f5d0f722ce579cb606cf.tar.gz |
wmapro: prevent division by zero when sample rate is unspecified
This fixes Bugzilla #327:
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec')
-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 699c1b7503..5fcafa29a7 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -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) { |