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)
This commit is contained in:
parent
bc7f6f6329
commit
d6d164f611
1 changed files with 3 additions and 0 deletions
|
@ -1830,6 +1830,9 @@ cache_image (struct frame *f, struct image *img)
|
||||||
struct image_cache *c = FRAME_IMAGE_CACHE (f);
|
struct image_cache *c = FRAME_IMAGE_CACHE (f);
|
||||||
ptrdiff_t i;
|
ptrdiff_t i;
|
||||||
|
|
||||||
|
if (!c)
|
||||||
|
c = FRAME_IMAGE_CACHE (f) = make_image_cache ();
|
||||||
|
|
||||||
/* Find a free slot in c->images. */
|
/* Find a free slot in c->images. */
|
||||||
for (i = 0; i < c->used; ++i)
|
for (i = 0; i < c->used; ++i)
|
||||||
if (c->images[i] == NULL)
|
if (c->images[i] == NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue