summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-02-10 10:51:43 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2012-02-11 08:13:53 -0800
commit7416d610362807848236ceff1bc6740dbc82842d (patch)
treea142b2239549b89240ac0a8e3f0cb58211fdef71 /libavcodec
parent6ab681a4c1ffc0d5c36ebf13a10e0ecc61c81429 (diff)
downloadffmpeg-streaming-7416d610362807848236ceff1bc6740dbc82842d.zip
ffmpeg-streaming-7416d610362807848236ceff1bc6740dbc82842d.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
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/tta.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 853f6a2..28d0e9b 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -223,6 +223,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) {
OpenPOWER on IntegriCloud