From efe658674bd103d1c9bf50809d5767a3f6dd5a01 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 5 Aug 2026 18:19:01 +0200 Subject: [PATCH] jpeg: When freeing memory, unset the size Fixes potential invalid write if a specifically crafted JPEG file would use markers to: 1. cause memory to be allocated 2. cause it to be freed due to an error 3. cause memory to be allocated again I did not attempt to craft such a file. --- gdk-pixbuf/io-jpeg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c index a225998b1..8434fd00d 100644 --- a/gdk-pixbuf/io-jpeg.c +++ b/gdk-pixbuf/io-jpeg.c @@ -389,6 +389,8 @@ out: if (!ret) { g_free (context->icc_profile); context->icc_profile = NULL; + context->icc_profile_size = 0; + context->icc_profile_size_allocated = 0; } return ret; } -- GitLab