mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 20:45:43 +00:00
fix(vulkan): avoid stale shared-memory backups
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user