Prevent a possibility of GdkPixbuf crashes

This commit is contained in:
Přemysl Eric Janouch 2023-06-13 13:35:53 +02:00
parent 41b5ddc744
commit 8d5885bfdf
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 0 deletions

View File

@ -3323,6 +3323,8 @@ fiv_io_open_from_data(
GError *err = NULL;
if ((surface = open_gdkpixbuf(data, len, ctx, &err))) {
g_clear_error(error);
} else if (!err) {
// Contrary to documentation, this is a possible outcome (libheif).
} else if (err->code == GDK_PIXBUF_ERROR_UNKNOWN_TYPE) {
g_error_free(err);
} else {