diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 2ef8ddaf..18a4465f 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -36900,7 +36900,7 @@ wuffs_png__decoder__decode_ihdr( } v_a32 = t_0; } - if (v_a32 >= 2147483648) { + if ((v_a32 == 0) || (v_a32 >= 2147483648)) { status = wuffs_base__make_status(wuffs_png__error__bad_header); goto exit; } else if (v_a32 >= 16777216) { @@ -36937,7 +36937,7 @@ wuffs_png__decoder__decode_ihdr( } v_a32 = t_1; } - if (v_a32 >= 2147483648) { + if ((v_a32 == 0) || (v_a32 >= 2147483648)) { status = wuffs_base__make_status(wuffs_png__error__bad_header); goto exit; } else if (v_a32 >= 16777216) { diff --git a/std/png/decode_png.wuffs b/std/png/decode_png.wuffs index 0ab771d9..41680d19 100644 --- a/std/png/decode_png.wuffs +++ b/std/png/decode_png.wuffs @@ -219,7 +219,7 @@ pri func decoder.decode_ihdr?(src: base.io_reader) { var a8 : base.u8 a32 = args.src.read_u32be?() - if a32 >= 0x8000_0000 { + if (a32 == 0) or (a32 >= 0x8000_0000) { return "#bad header" } else if a32 >= 0x0100_0000 { return "#unsupported PNG file" @@ -227,7 +227,7 @@ pri func decoder.decode_ihdr?(src: base.io_reader) { this.width = a32 a32 = args.src.read_u32be?() - if a32 >= 0x8000_0000 { + if (a32 == 0) or (a32 >= 0x8000_0000) { return "#bad header" } else if a32 >= 0x0100_0000 { return "#unsupported PNG file"