Skip to content

Commit 7c5d922

Browse files
committed
fix(png): increase allowed width/height limit
1 parent e0bc3dd commit 7c5d922

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/png.imageio/pnginput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ PNGInput::open(const std::string& name, ImageSpec& newspec)
165165
m_interlace_type, m_bg, m_spec,
166166
m_keep_unassociated_alpha);
167167
if (!ok || m_err
168-
|| !check_open(m_spec, { 0, 1 << 16, 0, 1 << 16, 0, 1, 0, 4 })) {
168+
|| !check_open(m_spec, { 0, 1 << 20, 0, 1 << 20, 0, 1, 0, 4 })) {
169169
close();
170170
return false;
171171
}

src/png.imageio/pngoutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ bool
135135
PNGOutput::open(const std::string& name, const ImageSpec& userspec,
136136
OpenMode mode)
137137
{
138-
if (!check_open(mode, userspec, { 0, 65535, 0, 65535, 0, 1, 0, 256 }))
138+
if (!check_open(mode, userspec, { 0, 1 << 20, 0, 1 << 20, 0, 1, 0, 4 }))
139139
return false;
140140

141141
// If not uint8 or uint16, default to uint8

0 commit comments

Comments
 (0)