From 4a042f939f46ccb5927277cd2176bc82d270f45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Molinari?= Date: Thu, 13 Jun 2024 18:57:49 +0200 Subject: [PATCH] shared: Fix uninitialised pointer in load_jpeg() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit image should be initialised to NULL in case image loading fails between setjmp() and xzalloc(). Signed-off-by: Loïc Molinari --- shared/image-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/image-loader.c b/shared/image-loader.c index a54e9983..c5131dcc 100644 --- a/shared/image-loader.c +++ b/shared/image-loader.c @@ -183,7 +183,7 @@ error_exit(j_common_ptr cinfo) static struct weston_image * load_jpeg(FILE *fp, uint32_t image_load_flags) { - struct weston_image *volatile image; + struct weston_image *volatile image = NULL; struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; struct jpeg_image_data jpeg_image_data = { 0 };