zink: Use memmove when dealing with overlapping memory
Fix defect reported by Coverity Scan. Overlapping buffer in memory copy Results in an undefined behavior CID: 1515598 Signed-off-by: Corentin Noël <corentin.noel@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26922>
This commit is contained in:
@@ -234,7 +234,7 @@ zink_clear(struct pipe_context *pctx,
|
||||
*/
|
||||
add_new_clear(fb_clear);
|
||||
struct zink_framebuffer_clear_data *clear = fb_clear->clears.data;
|
||||
memcpy(clear + 1, clear, num_clears);
|
||||
memmove(clear + 1, clear, num_clears);
|
||||
memcpy(&clear->color, &color, sizeof(color));
|
||||
} else {
|
||||
/* no void clear needed */
|
||||
|
Reference in New Issue
Block a user