From: "Ronald S. Bultje" <[email protected]>
Prevents a division by zero later on.
---
libavcodec/tta.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 49d5953..2fc1eb4 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) {
--
1.7.7.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel