[FFmpeg-cvslog] tta: error out if samplerate is zero.

Ronald S. Bultje git at videolan.org
Sun Feb 12 01:34:07 CET 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Fri Feb 10 10:51:43 2012 -0800| [7416d610362807848236ceff1bc6740dbc82842d] | committer: Ronald S. Bultje

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 at libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7416d610362807848236ceff1bc6740dbc82842d
---

 libavcodec/tta.c |    3 +++
 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) {



More information about the ffmpeg-cvslog mailing list