mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 08:47:28 +01:00
Have std/bmp reject RLE EOL if y out of bounds
This commit is contained in:
1 parent
267134df94
commit
47b114e948
2 files changed
+7
No files matched your search
@@ -17745,6 +17745,10 @@ wuffs_bmp__decoder__swizzle_rle(
|
||||
v_code = wuffs_base__load_u8be__no_bounds_check(iop_a_src);
|
||||
(iop_a_src += 1, wuffs_base__make_empty_struct());
|
||||
if (v_code < 2) {
|
||||
if ((self->private_impl.f_dst_y == self->private_impl.f_dst_y_end) && (v_code == 0)) {
|
||||
status = wuffs_base__make_status(wuffs_bmp__error__bad_rle_compression);
|
||||
goto exit;
|
||||
}
|
||||
wuffs_base__pixel_swizzler__swizzle_interleaved_transparent_black(&self->private_impl.f_swizzler, v_dst, v_dst_palette, 18446744073709551615u);
|
||||
self->private_impl.f_dst_x = 0;
|
||||
self->private_impl.f_dst_y += self->private_impl.f_dst_y_inc;
|
||||
|
||||
@@ -645,6 +645,9 @@ pri func decoder.swizzle_rle!(dst: ptr base.pixel_buffer, src: base.io_reader) b
|
||||
code = args.src.peek_u8()
|
||||
args.src.skip_u32_fast!(actual: 1, worst_case: 1)
|
||||
if code < 2 { // 0=EOL, 1=EOF.
|
||||
if (this.dst_y == this.dst_y_end) and (code == 0) {
|
||||
return "#bad RLE compression"
|
||||
}
|
||||
this.swizzler.swizzle_interleaved_transparent_black!(
|
||||
dst: dst,
|
||||
dst_palette: dst_palette,
|
||||
|
||||
Reference in new issue
Block a user