Prevent a possibility of GdkPixbuf crashes
This commit is contained in:
parent
41b5ddc744
commit
8d5885bfdf
2
fiv-io.c
2
fiv-io.c
|
@ -3323,6 +3323,8 @@ fiv_io_open_from_data(
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
if ((surface = open_gdkpixbuf(data, len, ctx, &err))) {
|
if ((surface = open_gdkpixbuf(data, len, ctx, &err))) {
|
||||||
g_clear_error(error);
|
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) {
|
} else if (err->code == GDK_PIXBUF_ERROR_UNKNOWN_TYPE) {
|
||||||
g_error_free(err);
|
g_error_free(err);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue