Skip to content

Commit

Permalink
add additional checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Azq2 committed Aug 23, 2024
1 parent bc5567e commit 293eb15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/xbz.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ export function convertXbzToFlash(buffer) {
finished = decompressor(buffer.subarray(w.offset, w.offset + w.size));
if (!finished)
throw new Error(`Unexpected EOF.`);
} else {
} else if (xbz.compressionType == 0) {
for (let w of xbz.writes)
writeFlash(w.addr, buffer.subarray(w.offset, w.offset + w.size));
} else {
throw new Error(`Unknown compression type: ${xbz.compressionType}`);
}

return flash;
Expand Down

0 comments on commit 293eb15

Please sign in to comment.