]> git.sesse.net Git - ffmpeg/commitdiff
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 2ac825554ec15e34cc4792c677d3ba5e11527f15..5532580e02239076d086a9078b5f75534db0c633 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;
             }