]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pixlet.c
avcodec/ac3dec_fixed: Fix runtime error: left shift of 419 by 23 places cannot be...
[ffmpeg] / libavcodec / pixlet.c
index 0dfd5edbf7e7a5a068ca6a043f52aaa3de8f3d22..0e541a9ccb40ebfc1e0d6b3562d53a43676230dd 100644 (file)
@@ -594,6 +594,10 @@ static int pixlet_decode_frame(AVCodecContext *avctx, void *data,
     width  = bytestream2_get_be32(&ctx->gb);
     height = bytestream2_get_be32(&ctx->gb);
 
+    if (    width > INT_MAX - (1U << (NB_LEVELS + 1))
+        || height > INT_MAX - (1U << (NB_LEVELS + 1)))
+        return AVERROR_INVALIDDATA;
+
     w = FFALIGN(width,  1 << (NB_LEVELS + 1));
     h = FFALIGN(height, 1 << (NB_LEVELS + 1));