From d6d164f6110a68a3acb816fd2ae7e55e71a18aef Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 16 Mar 2016 19:04:16 +0200 Subject: [PATCH] Avoid segfaults due to frame image cache being absent * src/image.c (cache_image): If the frame doesn't have an image cache, create it. (Bug#23028) --- src/image.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/image.c b/src/image.c index a44b90b78e7..e8418b840c6 100644 --- a/src/image.c +++ b/src/image.c @@ -1830,6 +1830,9 @@ cache_image (struct frame *f, struct image *img) struct image_cache *c = FRAME_IMAGE_CACHE (f); ptrdiff_t i; + if (!c) + c = FRAME_IMAGE_CACHE (f) = make_image_cache (); + /* Find a free slot in c->images. */ for (i = 0; i < c->used; ++i) if (c->images[i] == NULL) -- 2.39.2