diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index d1ad3bcd..502d2c41 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -17506,6 +17506,16 @@ wuffs_bmp__decoder__decode_frame( WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(3); } label__0__break:; + self->private_data.s_decode_frame[0].scratch = self->private_impl.f_pending_pad; + WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4); + if (self->private_data.s_decode_frame[0].scratch > ((uint64_t)(io2_a_src - iop_a_src))) { + self->private_data.s_decode_frame[0].scratch -= ((uint64_t)(io2_a_src - iop_a_src)); + iop_a_src = io2_a_src; + status = wuffs_base__make_status(wuffs_base__suspension__short_read); + goto suspend; + } + iop_a_src += self->private_data.s_decode_frame[0].scratch; + self->private_impl.f_pending_pad = 0; } self->private_impl.f_call_sequence = 3; @@ -17589,6 +17599,9 @@ wuffs_bmp__decoder__swizzle_none( self->private_impl.f_dst_x = 0; self->private_impl.f_dst_y += self->private_impl.f_dst_y_inc; if (self->private_impl.f_dst_y >= self->private_impl.f_height) { + if (self->private_impl.f_height > 0) { + self->private_impl.f_pending_pad = self->private_impl.f_pad_per_row; + } goto label__outer__break; } else if (self->private_impl.f_pad_per_row != 0) { self->private_impl.f_pending_pad = self->private_impl.f_pad_per_row; @@ -17957,6 +17970,9 @@ wuffs_bmp__decoder__swizzle_bitfields( self->private_impl.f_dst_x = 0; self->private_impl.f_dst_y += self->private_impl.f_dst_y_inc; if (self->private_impl.f_dst_y >= self->private_impl.f_height) { + if (self->private_impl.f_height > 0) { + self->private_impl.f_pending_pad = self->private_impl.f_pad_per_row; + } goto label__outer__break; } else if (self->private_impl.f_pad_per_row != 0) { self->private_impl.f_pending_pad = self->private_impl.f_pad_per_row; diff --git a/std/bmp/decode_bmp.wuffs b/std/bmp/decode_bmp.wuffs index cd51a47c..b32c53b3 100644 --- a/std/bmp/decode_bmp.wuffs +++ b/std/bmp/decode_bmp.wuffs @@ -458,6 +458,9 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader, } yield? base."$short read" } endwhile + + args.src.skip_u32?(n: this.pending_pad) + this.pending_pad = 0 } this.call_sequence = 3 @@ -500,6 +503,9 @@ pri func decoder.swizzle_none!(dst: ptr base.pixel_buffer, src: base.io_reader) this.dst_x = 0 this.dst_y ~mod+= this.dst_y_inc if this.dst_y >= this.height { + if this.height > 0 { + this.pending_pad = this.pad_per_row + } break.outer } else if this.pad_per_row <> 0 { this.pending_pad = this.pad_per_row @@ -838,6 +844,9 @@ pri func decoder.swizzle_bitfields!(dst: ptr base.pixel_buffer, src: base.io_rea this.dst_x = 0 this.dst_y ~mod+= this.dst_y_inc if this.dst_y >= this.height { + if this.height > 0 { + this.pending_pad = this.pad_per_row + } break.outer } else if this.pad_per_row <> 0 { this.pending_pad = this.pad_per_row