mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
efficient-compression-tool: fix segfault with gcc15
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/LzFind.c b/src/LzFind.c
|
||||
index 98d0ac6..f1bee55 100755
|
||||
--- a/src/LzFind.c
|
||||
+++ b/src/LzFind.c
|
||||
@@ -229,7 +229,7 @@ static unsigned short * GetMatches2(UInt32 lenLimit, UInt32 curMatch, UInt32 pos
|
||||
const unsigned char* _min = min;
|
||||
unsigned cnt = 0;
|
||||
if (_min < pb - (rle_len - len)) {_min = pb - (rle_len - len);}
|
||||
- while (rle_pos > _min && *(uint64_t*)(rle_pos - 8) == starter_full) {rle_pos-=8; cnt+=8;}
|
||||
+ while (rle_pos > _min && *(__typeof__(const uint64_t __attribute__((aligned(1))))*)(rle_pos - 8) == starter_full) {rle_pos-=8; cnt+=8;}
|
||||
if (cnt) {
|
||||
if (cnt + len > rle_len - 1) {cnt = rle_len - 1 - len;}
|
||||
curMatch_rle -= cnt;
|
||||
@@ -22,6 +22,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
patches = [
|
||||
# from https://github.com/fhanau/Efficient-Compression-Tool/issues/145
|
||||
./ect-gcc-15-O3-fix.patch
|
||||
];
|
||||
|
||||
# devendor libpng
|
||||
postPatch = ''
|
||||
substituteInPlace src/CMakeLists.txt \
|
||||
|
||||
Reference in New Issue
Block a user