summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c')
-rw-r--r--third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c b/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c
index bafa57b167..6a0de0486b 100644
--- a/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c
+++ b/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c
@@ -331,9 +331,8 @@ static gboolean load_increment(gpointer context, const guchar *buf, guint size,
GError **error) {
GdkPixbufJxlAnimation *decoder_state = context;
if (decoder_state->done == TRUE) {
- g_set_error(error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED,
- "JXL decoder load_increment called after end of file");
- return FALSE;
+ g_warning_once("Trailing data found at end of JXL file");
+ return TRUE;
}
JxlDecoderStatus status;
@@ -491,9 +490,8 @@ static gboolean load_increment(gpointer context, const guchar *buf, guint size,
decoder_state->frames->len - 1)
.data;
decoder_state->pixel_format.align = gdk_pixbuf_get_rowstride(output);
- guchar *dst = gdk_pixbuf_get_pixels(output);
- size_t num_pixels = decoder_state->xsize * decoder_state->ysize;
- size_t size = num_pixels * decoder_state->pixel_format.num_channels;
+ guint size;
+ guchar *dst = gdk_pixbuf_get_pixels_with_length(output, &size);
if (JXL_DEC_SUCCESS != JxlDecoderSetImageOutBuffer(
decoder_state->decoder,
&decoder_state->pixel_format, dst, size)) {