mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Read checksum bytes even if ignoring its value
This commit is contained in:
1 parent
72449fa0ec
commit
153d1276a1
6 files changed
+68
-50
No files matched your search
@@ -101,8 +101,8 @@ pub func decoder.decode?(dst writer1, src reader1)() {
|
||||
}
|
||||
yield z
|
||||
}
|
||||
// TODO: read the 4 bytes regardless of this.ignore_checksum.
|
||||
if (not this.ignore_checksum) and (checksum_got != in.src.read_u32be?()) {
|
||||
var checksum_want u32 = in.src.read_u32be?()
|
||||
if (not this.ignore_checksum) and (checksum_got != checksum_want) {
|
||||
// TODO: return error "checksum mismatch"
|
||||
}
|
||||
// TODO: handle the 4 byte ISIZE field.
|
||||
|
||||
@@ -61,8 +61,8 @@ pub func decoder.decode?(dst writer1, src reader1)() {
|
||||
}
|
||||
yield z
|
||||
}
|
||||
// TODO: read the 4 bytes regardless of this.ignore_checksum.
|
||||
if (not this.ignore_checksum) and (checksum_got != in.src.read_u32be?()) {
|
||||
var checksum_want u32 = in.src.read_u32be?()
|
||||
if (not this.ignore_checksum) and (checksum_got != checksum_want) {
|
||||
return error "checksum mismatch"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user