std/xz: support BCJ start option

This commit is contained in:
Nigel Tao committed 2024-02-12 21:01:27 +11:00
1 parent 6f4db1b138
commit 782e78a689
7 files changed
+62 -23

No files matched your search

+6 -3
View File
@@ -386,7 +386,6 @@ pri func decoder.decode_block_header_sans_padding?(src: base.io_reader) {
// Configure the non-final filters.
this.bcj_pos = 0
this.bcj_x86_prev_mask = 0
choose apply_non_final_filters = [apply_non_final_filters]
f = 0
@@ -438,9 +437,13 @@ pri func decoder.decode_block_header_sans_padding?(src: base.io_reader) {
} else {
choose apply_non_final_filters = [apply_filter_0a_arm64]
}
// We only support a zero BCJ offset.
c8 = args.src.read_u8?()
if c8 <> 0x00 {
if c8 == 0x00 {
this.bcj_pos = 0
} else if c8 == 0x04 {
this.bcj_pos = args.src.read_u32le?()
} else {
return "#unsupported filter"
}
}