[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-27 075f21c 1/2: Avoid crash by access to cleared img->pixmap->data
From: |
YAMAMOTO Mitsuharu |
Subject: |
emacs-27 075f21c 1/2: Avoid crash by access to cleared img->pixmap->data/img->mask->data (Bug#38774) |
Date: |
Mon, 6 Jan 2020 22:45:38 -0500 (EST) |
branch: emacs-27
commit 075f21c0e3f4893c07c93298368ef8ac7c9eb012
Author: YAMAMOTO Mitsuharu <address@hidden>
Commit: YAMAMOTO Mitsuharu <address@hidden>
Avoid crash by access to cleared img->pixmap->data/img->mask->data
(Bug#38774)
* src/image.c (prepare_image_for_display) [USE_CAIRO]: Call IMAGE_BACKGROUND
and IMAGE_BACKGROUND_TRANSPARENT.
---
src/image.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/image.c b/src/image.c
index 5fe0d71..e36253b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1242,6 +1242,10 @@ prepare_image_for_display (struct frame *f, struct image
*img)
if (img->cr_data == NULL || (cairo_pattern_get_type (img->cr_data)
!= CAIRO_PATTERN_TYPE_SURFACE))
{
+ /* Fill in the background/background_transparent field while
+ we have img->pixmap->data/img->mask->data. */
+ IMAGE_BACKGROUND (img, f, img->pixmap);
+ IMAGE_BACKGROUND_TRANSPARENT (img, f, img->mask);
cr_put_image_to_cr_data (img);
if (img->cr_data == NULL)
{