Skip to content

Commit

Permalink
Merge pull request #5 from sincos2854/main
Browse files Browse the repository at this point in the history
Fix bugs and update libjxl
  • Loading branch information
uyjulian authored Mar 19, 2023
2 parents c0b0834 + 336175a commit 7b1fa23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions extractor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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)
{
Expand Down

0 comments on commit 7b1fa23

Please sign in to comment.