Skip to content

Commit 0679c2c

Browse files
committed
fix: Reduce max size for png and exr input
Signed-off-by: Dharshan Vishwanatha <dharshanv1999@gmail.com>
1 parent 6819d64 commit 0679c2c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/openexr.imageio/exrinput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ OpenEXRInput::seek_subimage(int subimage, int miplevel)
10241024
m_miplevel = miplevel;
10251025
m_spec = part.spec;
10261026

1027-
if (!check_open(m_spec, { 0, 1 << 30, 0, 1 << 30, 0, 1 << 16, 0, 1 << 16 }))
1027+
if (!check_open(m_spec, { 0, 1 << 20, 0, 1 << 20, 0, 1 << 16, 0, 1 << 12 }))
10281028
return false;
10291029

10301030
if (miplevel == 0 && part.levelmode == Imf::ONE_LEVEL) {

src/png.imageio/pnginput.cpp

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

0 commit comments

Comments
 (0)