mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-06 21:12:12 +00:00
glz_dictionary_window_add_image: error out when failed to alloc an image
__glz_dictionary_window_alloc_image may return NULL. Check that the image was created successfully and if not then error out using dict->cur_usr->error like it's done few lines below. Signed-off-by: Uri Lublin <uril@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
031ab732dd
commit
21323c8b6f
@ -495,6 +495,9 @@ static WindowImage *glz_dictionary_window_add_image(SharedDictionary *dict, LzIm
|
||||
uint8_t* lines = first_lines;
|
||||
// alloc image info,update used head tail, if used_head null - update head
|
||||
WindowImage *image = __glz_dictionary_window_alloc_image(dict);
|
||||
if (!image) {
|
||||
dict->cur_usr->error(dict->cur_usr, "glz-dictionary failed to allocate an image\n");
|
||||
}
|
||||
image->id = dict->last_image_id++;
|
||||
image->size = image_size;
|
||||
image->type = image_type;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user