diff options
author | Sean McGovern <gseanmcg@gmail.com> | 2012-08-02 15:37:28 -0400 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2012-08-03 07:07:00 +0200 |
commit | 3680b2435101a5de56821718a71c828320d535a0 (patch) | |
tree | 3fa9c31682b136c5880f7162d28faaac80bdf3ba /libavcodec | |
parent | 03737412a32c3b7e52cfe661bde7947665898c19 (diff) | |
download | ffmpeg-3680b2435101a5de56821718a71c828320d535a0.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>
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 30a43c8585..699c1b7503 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -335,6 +335,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) { |