From 4adbb44ad154cec05e87de60bb827a13c0fe87df Mon Sep 17 00:00:00 2001
From: Anton Khirnov <anton@khirnov.net>
Date: Wed, 23 Nov 2016 13:02:53 +0100
Subject: [PATCH] tta: avoid undefined shifts

Signed-off-by: Diego Biurrun <diego@biurrun.de>
---
 libavcodec/tta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 2ac825554ec..5532580e022 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -360,7 +360,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
         }
 
         if (k) {
-            if (k > MIN_CACHE_BITS) {
+            if (k >= 32 || unary > INT32_MAX >> k) {
                 ret = AVERROR_INVALIDDATA;
                 goto error;
             }
-- 
GitLab