From: Jerome Glisse <jgli...@redhat.com>

pipe_transfer_map already offset the surface properly so using the offset
again with util_copy_rect might lead to read/write outside the surface.

Signed-off-by: Jerome Glisse <jgli...@redhat.com>
---
 src/gallium/state_trackers/xa/xa_context.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/xa/xa_context.c 
b/src/gallium/state_trackers/xa/xa_context.c
index badd47c..07953a4 100644
--- a/src/gallium/state_trackers/xa/xa_context.c
+++ b/src/gallium/state_trackers/xa/xa_context.c
@@ -116,11 +116,10 @@ xa_surface_dma(struct xa_context *ctx,
 
        if (to_surface) {
            util_copy_rect(map, srf->tex->format, transfer->stride,
-                          0, 0, w, h, data, pitch, boxes->x1, boxes->y1);
+                          0, 0, w, h, data, pitch, 0, 0);
        } else {
            util_copy_rect(data, srf->tex->format, pitch,
-                          boxes->x1, boxes->y1, w, h, map, transfer->stride, 0,
-                          0);
+                          0, 0, w, h, map, transfer->stride, 0, 0);
        }
        pipe->transfer_unmap(pipe, transfer);
        if (to_surface)
-- 
1.8.1.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to