From a1ca153d51b88be2349d3e44aadf87330814f46c Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Thu, 11 Jul 2024 15:59:32 +0200 Subject: [PATCH] Fix hidden myerr in my_error_exit Change-Id: I0e3660eff2f6a20446b6fcd2925312757fda424c --- imageio/jpegdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageio/jpegdec.c b/imageio/jpegdec.c index d87510f5..7bce1206 100644 --- a/imageio/jpegdec.c +++ b/imageio/jpegdec.c @@ -205,12 +205,12 @@ struct my_error_mgr { }; static void my_error_exit(j_common_ptr dinfo) { + struct my_error_mgr* myerr = (struct my_error_mgr*)dinfo->err; // The following code is disabled in fuzzing mode because: // - the logs can be flooded due to invalid JPEG files // - msg_code is wrongfully seen as uninitialized by msan when the libjpeg // dependency is not built with sanitizers enabled #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION - struct my_error_mgr* myerr = (struct my_error_mgr*)dinfo->err; const int msg_code = myerr->pub.msg_code; fprintf(stderr, "libjpeg error: "); dinfo->err->output_message(dinfo);