mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 08:32:11 +01:00
Have std/png reject zero width or height
This commit is contained in:
1 parent
97f5bec0e3
commit
3358730f6f
2 files changed
+4
-4
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user