Refactor std/png decoder.tell_me_more

This commit is contained in:
Nigel Tao committed 2021-11-26 19:45:42 +11:00
1 parent 72d4a9e769
commit 5d1473a2ca
2 files changed
+36 -32

No files matched your search

+15 -13
View File
@@ -1651,21 +1651,23 @@ pub func decoder.tell_me_more?(dst: base.io_writer, minfo: nptr base.more_inform
this.metadata_is_zlib_compressed = true
}
} else {
if this.chunk_length <> 0 {
return "#bad chunk"
}
// Skip the ancillary chunk's CRC-32 checksum.
args.src.skip?(n: 4)
this.metadata_flavor = 0
this.metadata_fourcc = 0
this.metadata_x = 0
this.metadata_y = 0
this.metadata_z = 0
this.call_sequence = 2
return ok
}
if this.chunk_length <> 0 {
return "#bad chunk"
}
// Skip the ancillary chunk's CRC-32 checksum.
args.src.skip?(n: 4)
this.metadata_flavor = 0
this.metadata_fourcc = 0
this.metadata_x = 0
this.metadata_y = 0
this.metadata_z = 0
this.call_sequence = 2
return ok
}