From 37b93ea46059b877e996cee159a7c9c481f04df5 Mon Sep 17 00:00:00 2001 From: sincos2854 Date: Sun, 19 Mar 2023 15:14:19 +0900 Subject: [PATCH 1/2] Fix handling of decoding errors --- extractor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extractor.c b/extractor.c index 864a171..ed1d447 100755 --- a/extractor.c +++ b/extractor.c @@ -140,6 +140,7 @@ int getBMPFromJXL(const uint8_t* input_data, size_t file_size,HANDLE* h_bitmap_i if (NULL == bitmap_data) { LocalFree(*h_bitmap_data); + *h_bitmap_data = NULL; DBGFPRINTF(stderr, "Memory error\n"); ret = 0; goto cleanup; @@ -213,6 +214,7 @@ int getBMPFromJXL(const uint8_t* input_data, size_t file_size,HANDLE* h_bitmap_i if (NULL == bitmap_info_header) { LocalFree(*h_bitmap_info); + *h_bitmap_info = NULL; DBGFPRINTF(stderr, "Memory error\n"); ret = 0; goto cleanup; @@ -234,11 +236,13 @@ int getBMPFromJXL(const uint8_t* input_data, size_t file_size,HANDLE* h_bitmap_i { LocalUnlock(*h_bitmap_data); LocalFree(*h_bitmap_data); + *h_bitmap_data = NULL; } if (NULL != bitmap_info_header && 0 == ret) { LocalUnlock(*h_bitmap_info); LocalFree(*h_bitmap_info); + *h_bitmap_info = NULL; } if (NULL != runner) { From 336175a752531b71a051ed0520071b191cad80af Mon Sep 17 00:00:00 2001 From: sincos2854 Date: Sun, 19 Mar 2023 15:31:04 +0900 Subject: [PATCH 2/2] Update libjxl version to v0.8.1 --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 787edbf..f07e3ba 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ DEPENDENCY_SOURCE_DIRECTORY_LIBJXL := $(DEPENDENCY_SOURCE_DIRECTORY)/libjxl DEPENDENCY_SOURCE_URL_LIBJXL := https://github.com/libjxl/libjxl.git $(DEPENDENCY_SOURCE_DIRECTORY_LIBJXL): | $(DEPENDENCY_SOURCE_DIRECTORY) - git clone --depth 1 --branch v0.8.0 --recursive --shallow-submodules $(DEPENDENCY_SOURCE_URL_LIBJXL) $@ + git clone --depth 1 --branch v0.8.1 --recursive --shallow-submodules $(DEPENDENCY_SOURCE_URL_LIBJXL) $@ $(DEPENDENCY_OUTPUT_DIRECTORY)/lib/libjxl_threads.a: $(DEPENDENCY_OUTPUT_DIRECTORY)/lib/libjxl.a $(DEPENDENCY_OUTPUT_DIRECTORY)/lib/libhwy.a: $(DEPENDENCY_OUTPUT_DIRECTORY)/lib/libjxl.a @@ -195,6 +195,7 @@ $(DEPENDENCY_OUTPUT_DIRECTORY)/lib/libjxl.a: | $(DEPENDENCY_SOURCE_DIRECTORY_LIB -DBUILD_TESTING=OFF \ -DJPEGXL_ENABLE_TOOLS=OFF \ -DJPEGXL_ENABLE_VIEWERS=OFF \ + -DJPEGXL_STATIC=ON \ && \ cmake --build $(DEPENDENCY_BUILD_DIRECTORY_LIBJXL) && \ cmake --build $(DEPENDENCY_BUILD_DIRECTORY_LIBJXL) --target install