From: Shitiz Garg <shitiz@shitiz-VirtualBox.(none)>

---
 libavcodec/tta.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 6b76f52..c8d58fd 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -221,6 +221,11 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
         s->data_length = get_bits_long(&s->gb, 32);
         skip_bits(&s->gb, 32); // CRC32 of header
 
+        if (s->channels == 0) {
+            av_log(s->avctx, AV_LOG_ERROR, "Invalid number of channels\n");
+            return AVERROR_INVALIDDATA;
+        }
+
         switch(s->bps) {
         case 2:
             avctx->sample_fmt = AV_SAMPLE_FMT_S16;
-- 
1.7.5.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to