From 66771223608320969bd93823eac50987e4445564 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 13 May 2025 10:33:15 -0400 Subject: [PATCH] cjpeg: Free ICC profile if API error when fuzzing Fixes #809 --- src/cjpeg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cjpeg.c b/src/cjpeg.c index 49509997..22da5382 100644 --- a/src/cjpeg.c +++ b/src/cjpeg.c @@ -7,7 +7,8 @@ * Lossless JPEG Modifications: * Copyright (C) 1999, Ken Murchison. * libjpeg-turbo Modifications: - * Copyright (C) 2010, 2013-2014, 2017, 2019-2022, 2024, D. R. Commander. + * Copyright (C) 2010, 2013-2014, 2017, 2019-2022, 2024-2025, + * D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -185,6 +186,7 @@ static void my_emit_message_fuzzer(j_common_ptr cinfo, int msg_level) fclose(input_file); \ if (memdst) \ free(outbuffer); \ + free(icc_profile); \ return EXIT_FAILURE; \ }