diff --git a/contrib/gdk-pixbuf/loader.c b/contrib/gdk-pixbuf/loader.c index dbbf5717f5..c7f39e6bc2 100644 --- a/contrib/gdk-pixbuf/loader.c +++ b/contrib/gdk-pixbuf/loader.c @@ -241,7 +241,7 @@ GdkPixbuf* set_pixbuf(AvifAnimation * context, GError ** error) GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, "Insufficient memory to open AVIF file"); - return FALSE; + return NULL; } rgb.pixels = gdk_pixbuf_get_pixels(output); @@ -252,7 +252,7 @@ GdkPixbuf* set_pixbuf(AvifAnimation * context, GError ** error) g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED, "Failed to convert YUV to RGB: %s", avifResultToString(ret)); g_object_unref(output); - return FALSE; + return NULL; } /* transformations */ @@ -361,7 +361,7 @@ GdkPixbuf* set_pixbuf(AvifAnimation * context, GError ** error) GDK_PIXBUF_ERROR_CORRUPT_IMAGE, "Transformed AVIF has zero width or height"); g_object_unref(output); - return FALSE; + return NULL; } if ( width < gdk_pixbuf_get_width(output) || @@ -424,6 +424,10 @@ static gboolean avif_context_try_load(AvifAnimation * context, GError ** error) frame.pixbuf = set_pixbuf(context, error); frame.duration_ms = (uint64_t)(decoder->imageTiming.duration * 1000); + if (frame.pixbuf == NULL) { + return FALSE; + } + g_array_append_val(context->frames, frame); context->prepared_func(g_array_index(context->frames, AvifAnimationFrame, 0).pixbuf,