From f9cd8446efe1a33d1de5f3d60bf957bc006fa84f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 6 Aug 2023 22:26:57 -0700 Subject: [PATCH] lavapipe: Fix struct initialization Fix defect reported by Coverity Scan. Evaluation order violation (EVALUATION_ORDER) write_write_typo: In box.x = box.x = copy->imageOffset.x, box.x is written twice with the same value. Fixes: 9e9d90c6c38 ("lavapipe: VK_EXT_host_image_copy") Signed-off-by: Vinson Lee Reviewed-by: Konstantin Seurer Reviewed-by: Mike Blumenkrantz Part-of: --- src/gallium/frontends/lavapipe/lvp_image.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_image.c b/src/gallium/frontends/lavapipe/lvp_image.c index d6db34a925a..07585fef528 100644 --- a/src/gallium/frontends/lavapipe/lvp_image.c +++ b/src/gallium/frontends/lavapipe/lvp_image.c @@ -672,10 +672,10 @@ lvp_CopyImageToMemoryEXT(VkDevice _device, const VkCopyImageToMemoryInfoEXT *pCo for (unsigned i = 0; i < pCopyImageToMemoryInfo->regionCount; i++) { const VkImageToMemoryCopyEXT *copy = &pCopyImageToMemoryInfo->pRegions[i]; struct pipe_box box = { - box.x = copy->imageOffset.x, - box.y = copy->imageOffset.y, - box.width = copy->imageExtent.width, - box.height = copy->imageExtent.height, + .x = copy->imageOffset.x, + .y = copy->imageOffset.y, + .width = copy->imageExtent.width, + .height = copy->imageExtent.height, .depth = 1, }; switch (image->bo->target) {