gdk: Bump the jpeg malloc limit
authorMatthias Clasen <mclasen@redhat.com>
Tue, 1 Nov 2022 00:35:15 +0000 (20:35 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 1 Nov 2022 00:35:15 +0000 (20:35 -0400)
Bump the limit for memory use during jpeg loading
to 1GB, matching what gdk-pixbuf has for this.

gdk/loaders/gdkjpeg.c

index ba6731ac1112dbe7574167d1b4cb5e0eef417d1e..d0520cf9e8224f199e3710eef781abf77adf257a 100644 (file)
@@ -161,7 +161,8 @@ gdk_load_jpeg (GBytes  *input_bytes,
 
   jpeg_create_decompress (&info);
 
-  info.mem->max_memory_to_use = 300 * 1024 * 1024;
+  /* Limit to 1GB to avoid OOM with large images */
+  info.mem->max_memory_to_use = 1024 * 1024 * 1024;
 
   jpeg_mem_src (&info,
                 g_bytes_get_data (input_bytes, NULL),