panfrost: Guard against reading past end of buffer
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 11 Apr 2019 07:09:59 +0000 (09:09 +0200)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Fri, 12 Apr 2019 05:12:17 +0000 (07:12 +0200)
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/pan_swizzle.c

index 291bd1f88aea1b1f8fa26df6808671dec48b7807..52a907ddd55d14c26f2b89d37b2c2718f2b873dc 100644 (file)
@@ -97,6 +97,9 @@ swizzle_bpp1_align16(int width, int height, int source_stride, int block_pitch,
 
                 ++y;
 
+                if (y >= height)
+                        break;
+
                 {
                         int block_y = y & ~(0x0f);
                         int rem_y = y & 0x0f;