loader/dri3: do not blit outside old/new buffers
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 25 Mar 2019 08:47:58 +0000 (09:47 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 3 Oct 2019 18:58:34 +0000 (18:58 +0000)
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/loader/loader_dri3_helper.c

index e49b39e7d86c0722f3c2ba15e315623eda86c619..3ce47cd3d6b4d4a8bdbfafd4867000950092865b 100644 (file)
@@ -1841,7 +1841,9 @@ dri3_get_buffer(__DRIdrawable *driDrawable,
          if (!loader_dri3_blit_image(draw,
                                      new_buffer->image,
                                      buffer->image,
          if (!loader_dri3_blit_image(draw,
                                      new_buffer->image,
                                      buffer->image,
-                                     0, 0, draw->width, draw->height,
+                                     0, 0,
+                                     MIN2(buffer->width, new_buffer->width),
+                                     MIN2(buffer->height, new_buffer->height),
                                      0, 0, 0) &&
              !buffer->linear_buffer) {
             dri3_fence_reset(draw->conn, new_buffer);
                                      0, 0, 0) &&
              !buffer->linear_buffer) {
             dri3_fence_reset(draw->conn, new_buffer);