Fix hidden myerr in my_error_exit

Change-Id: I0e3660eff2f6a20446b6fcd2925312757fda424c
This commit is contained in:
Vincent Rabaud 2024-07-11 15:59:32 +02:00
parent 3bd9420289
commit a1ca153d51

View File

@ -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);