tta: avoid undefined shifts
authorAnton Khirnov <anton@khirnov.net>
Wed, 23 Nov 2016 12:02:53 +0000 (13:02 +0100)
committerDiego Biurrun <diego@biurrun.de>
Fri, 25 Nov 2016 20:42:33 +0000 (21:42 +0100)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavcodec/tta.c

index 2ac8255..5532580 100644 (file)
@@ -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;
             }