Skip to content

Commit

Permalink
Minor merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NeRdTheNed committed Nov 12, 2023
1 parent 65be1b8 commit fe818cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,7 @@ public DeflateBlock merge(DeflateBlock append) {
merged.litlenSizeBits += otherFixed.litlenSizeBits;
merged.litlenSizeBits -= getLitLenSize(eob, merged.litlenDec, merged.distDec);
merged.sizeBits += merged.litlenSizeBits;
merged.setNext(append.getNext());
return merged;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,13 @@ public long mergeBlocks() {

currentBlock.replace(merged);
currentBlock.discard();
merged.setNext(nextBlock.getNext());
final DeflateBlock next = nextBlock.getNext();
merged.setNext(next);

if (next != null) {
next.setPrevious(merged);
}

currentBlock = merged;

if (first) {
Expand Down

0 comments on commit fe818cd

Please sign in to comment.