diff options
Diffstat (limited to 'third_party/jpeg-xl/plugins/gdk-pixbuf')
-rw-r--r-- | third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader-jxl.c | 10 | ||||
-rw-r--r-- | third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader_test.cc | 7 |
2 files changed, 8 insertions, 9 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)) { diff --git a/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader_test.cc b/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader_test.cc index 5e5642d491..a2e5dc9703 100644 --- a/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader_test.cc +++ b/third_party/jpeg-xl/plugins/gdk-pixbuf/pixbufloader_test.cc @@ -16,12 +16,13 @@ int main(int argc, char* argv[]) { const char* loaders_cache = argv[1]; const char* filename = argv[2]; - setenv("GDK_PIXBUF_MODULE_FILE", loaders_cache, true); + const int kDoOverwrite = 1; + setenv("GDK_PIXBUF_MODULE_FILE", loaders_cache, kDoOverwrite); // XDG_DATA_HOME is the path where we look for the mime cache. // XDG_DATA_DIRS directories are used in addition to XDG_DATA_HOME. - setenv("XDG_DATA_HOME", ".", true); - setenv("XDG_DATA_DIRS", "", true); + setenv("XDG_DATA_HOME", ".", kDoOverwrite); + setenv("XDG_DATA_DIRS", "", kDoOverwrite); if (!gdk_init_check(nullptr, nullptr)) { fprintf(stderr, "This test requires a DISPLAY\n"); |