panfrost: Prevent potential integer overflow in instancing
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 21 Aug 2019 16:30:12 +0000 (09:30 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 21 Aug 2019 17:38:31 +0000 (10:38 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_instancing.c

index cd93fa7be9c38079a72ab019cf02a8dfbe6dfdeb..30023725b2e2a22c221e2e1cea97cb64596ed738 100644 (file)
@@ -228,7 +228,7 @@ panfrost_vertex_instanced(
 
                 /* Apply round-down algorithm? e <= 2^shift?. XXX: The blob
                  * seems to use a different condition */
 
                 /* Apply round-down algorithm? e <= 2^shift?. XXX: The blob
                  * seems to use a different condition */
-                if (e <= (1 << shift)) {
+                if (e <= (1ll << shift)) {
                         magic_divisor = m - 1;
                         extra_flags = 1;
                 }
                         magic_divisor = m - 1;
                         extra_flags = 1;
                 }