[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/memrep 7989fb6 4/4: Check whether img exists before computing th
From: |
Lars Ingebrigtsen |
Subject: |
scratch/memrep 7989fb6 4/4: Check whether img exists before computing the size |
Date: |
Thu, 10 Dec 2020 07:08:20 -0500 (EST) |
branch: scratch/memrep
commit 7989fb653010fff2b939569285e7cc2bcf809a95
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Check whether img exists before computing the size
---
src/image.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/image.c b/src/image.c
index 4917808..38887ce 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1805,8 +1805,9 @@ image_frame_cache_size (struct frame *f)
{
struct image *img = c->images[i];
- total += img->pixmap->width * img->pixmap->height *
- img->pixmap->bits_per_pixel / 8;
+ if (img)
+ total += img->pixmap->width * img->pixmap->height *
+ img->pixmap->bits_per_pixel / 8;
}
return total;
}