mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Fix std/png decode_other_chunk skipping chunks
This commit is contained in:
1 parent
2373340f83
commit
9c3d27fb43
2 files changed
+6
-2
No files matched your search
@@ -37883,7 +37883,8 @@ wuffs_png__decoder__decode_other_chunk(
|
||||
goto suspend;
|
||||
}
|
||||
self->private_impl.f_seen_trns = true;
|
||||
} else {
|
||||
}
|
||||
if (self->private_impl.f_metadata_fourcc == 0) {
|
||||
self->private_data.s_decode_other_chunk[0].scratch = self->private_impl.f_chunk_length;
|
||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(7);
|
||||
if (self->private_data.s_decode_other_chunk[0].scratch > ((uint64_t)(io2_a_src - iop_a_src))) {
|
||||
@@ -38416,6 +38417,7 @@ wuffs_png__decoder__decode_plte(
|
||||
goto exit;
|
||||
}
|
||||
v_num_entries = (((uint32_t)(self->private_impl.f_chunk_length)) / 3);
|
||||
self->private_impl.f_chunk_length = 0;
|
||||
while (v_i < v_num_entries) {
|
||||
{
|
||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user