Skip to content

Commit a11ee11

Browse files
authored
dicom: enforce reasonable resolution limits to guard against corrupt file (#5167)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent 6ea45b1 commit a11ee11

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/dicom.imageio/dicominput.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ DICOMInput::seek_subimage(int subimage, int miplevel)
231231

232232
m_spec = ImageSpec(m_img->getWidth(), m_img->getHeight(), nchannels,
233233
format);
234+
if (!check_open(m_spec, { 0, 1 << 20, 0, 1 << 20, 0, 1 << 16, 0, 1 << 16 }))
235+
return false;
234236

235237
m_bitspersample = m_img->getDepth();
236238
if (size_t(m_bitspersample) != m_spec.format.size() * 8)

0 commit comments

Comments
 (0)