]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/g2meet: Fix potential overflow in tile dimensions check
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Sep 2015 10:10:02 +0000 (12:10 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Sep 2015 10:14:13 +0000 (12:14 +0200)
Fixes CID1322351

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/g2meet.c

index b1457b7f9798bde2b058a4f395ff5376679517ad..487b75f1546b5550599dc58f7a53b53bcaf87af7 100644 (file)
@@ -1448,7 +1448,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
             c->tile_height = bytestream2_get_be32(&bc);
             if (c->tile_width <= 0 || c->tile_height <= 0 ||
                 ((c->tile_width | c->tile_height) & 0xF) ||
-                c->tile_width * 4LL * c->tile_height >= INT_MAX
+                c->tile_width * (uint64_t)c->tile_height >= INT_MAX / 4
             ) {
                 av_log(avctx, AV_LOG_ERROR,
                        "Invalid tile dimensions %dx%d\n",