Fix std/png decode_other_chunk skipping chunks

This commit is contained in:
Nigel Tao committed 2021-11-09 22:10:00 +11:00
1 parent 2373340f83
commit 9c3d27fb43
2 files changed
+6 -2

No files matched your search

+3 -1
View File
@@ -495,8 +495,9 @@ pri func decoder.decode_other_chunk?(src: base.io_reader) {
}
this.decode_trns?(src: args.src)
this.seen_trns = true
}
} else {
if this.metadata_fourcc == 0 {
args.src.skip?(n: this.chunk_length)
}
}
@@ -591,6 +592,7 @@ pri func decoder.decode_plte?(src: base.io_reader) {
return "#bad chunk"
}
num_entries = (this.chunk_length as base.u32) / 3
this.chunk_length = 0
while i < num_entries {
assert i < 256 via "a < b: a < c; c <= b"(c: num_entries)