diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-02-10 10:51:43 -0800 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-02-26 10:03:15 +0100 |
commit | 7046ae55932f8fae83269871847cea9fd84c23f5 (patch) | |
tree | acad243ae781eb4553344472d24524a75d330b06 | |
parent | d19e3e19d67b50cb5614ead2e0f125678e1c257d (diff) | |
download | ffmpeg-7046ae55932f8fae83269871847cea9fd84c23f5.tar.gz |
tta: error out if samplerate is zero.
Prevents a division by zero later on.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 7416d610362807848236ceff1bc6740dbc82842d)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavcodec/tta.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 4656ce12e6..c8daff278c 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -224,6 +224,9 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) if (s->channels == 0) { av_log(s->avctx, AV_LOG_ERROR, "Invalid number of channels\n"); return AVERROR_INVALIDDATA; + } else if (avctx->sample_rate == 0) { + av_log(s->avctx, AV_LOG_ERROR, "Invalid samplerate\n"); + return AVERROR_INVALIDDATA; } switch(s->bps) { |