Fix LZ11 compression.
This commit is contained in:
parent
553949f57b
commit
6e01561b5e
@ -19,25 +19,27 @@ u32 lz11_get_occurence_length(u8* newPtr, u32 newLength, u8* oldPtr, u32 oldLeng
|
|||||||
}
|
}
|
||||||
|
|
||||||
u32 maxLength = 0;
|
u32 maxLength = 0;
|
||||||
for(u32 i = 0; i < oldLength - 1; i++) {
|
if(oldLength > 0) {
|
||||||
u8* currentOldStart = oldPtr + i;
|
for(u32 i = 0; i < oldLength - 1; i++) {
|
||||||
u32 currentLength = 0;
|
u8* currentOldStart = oldPtr + i;
|
||||||
for(u32 j = 0; j < newLength; j++) {
|
u32 currentLength = 0;
|
||||||
if(*(currentOldStart + j) != *(newPtr + j)) {
|
for(u32 j = 0; j < newLength; j++) {
|
||||||
break;
|
if(*(currentOldStart + j) != *(newPtr + j)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentLength++;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentLength++;
|
if(currentLength > maxLength) {
|
||||||
}
|
maxLength = currentLength;
|
||||||
|
if(disp != NULL) {
|
||||||
|
*disp = oldLength - i;
|
||||||
|
}
|
||||||
|
|
||||||
if(currentLength > maxLength) {
|
if(maxLength == newLength) {
|
||||||
maxLength = currentLength;
|
break;
|
||||||
if(disp != NULL) {
|
}
|
||||||
*disp = oldLength - i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(maxLength == newLength) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user