Skip to content

Commit

Permalink
Merge pull request #132 from stenzek/master
Browse files Browse the repository at this point in the history
chd: Fix various memory and overflow bugs
  • Loading branch information
rtissera authored Nov 10, 2024
2 parents aaca599 + 09fa975 commit 51d1f28
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 44 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ if(BUILD_LTO)
endif()
endif()

option(BUILD_FUZZER "Build instrumented binary for fuzzing with libfuzzer, requires clang")
if(BUILD_FUZZER)
# Override CFLAGS early for instrumentation. Disable shared libs for instrumentation.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address,fuzzer-no-link")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,fuzzer-no-link")
set(BUILD_SHARED_LIBS OFF)
endif()

include(GNUInstallDirs)

#--------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion include/libchdr/huffman.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ int huffman_build_tree(struct huffman_decoder* decoder, uint32_t totaldata, uint
enum huffman_error huffman_assign_canonical_codes(struct huffman_decoder* decoder);
enum huffman_error huffman_compute_tree_from_histo(struct huffman_decoder* decoder);

void huffman_build_lookup_table(struct huffman_decoder* decoder);
enum huffman_error huffman_build_lookup_table(struct huffman_decoder* decoder);

#endif
Loading

0 comments on commit 51d1f28

Please sign in to comment.