summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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)) {