fix(vulkan): avoid stale shared-memory backups

This commit is contained in:
LunaDL committed 2026-11-27 18:47:27 -04:00
1 parent 7e60e36195
commit a4337db148
1 file changed
+2
@@ -780,6 +780,8 @@ static void suspend_client_images(void) {
for (struct vkp_image *img = g_client_images; img; img = img->next) {
if (img->source_type == VKP_IMAGE_SOURCE_SHM && img->map && img->w > 0 && img->h > 0) {
const size_t row_bytes = (size_t)img->w * 4;
free(img->recovery_pixels);
img->recovery_pixels = NULL;
if ((size_t)img->h <= SIZE_MAX / row_bytes) {
const size_t bytes = row_bytes * (size_t)img->h;
img->recovery_pixels = malloc(bytes);