Skip to content

Commit 3f77161

Browse files
committed
Fixed ICO issue from CVE-2020-24292
1 parent 2f023a5 commit 3f77161

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Source/Plugins/PluginICO.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,13 @@ LoadStandardIcon(FreeImageIO *io, fi_handle handle, int flags, FIBOOL header_onl
324324
return dib.release();
325325
}
326326

327+
327328
// read the icon
329+
if (bit_count != FreeImage_GetBPP(dib.get()) || pitch != FreeImage_GetPitch(dib.get())) {
330+
// same pitch is assumed in read_proc
331+
return nullptr;
332+
}
333+
// ToDo: Need to support line by line reading if pitch is different?
328334
io->read_proc(FreeImage_GetBits(dib.get()), height * pitch, 1, handle);
329335

330336
#ifdef FREEIMAGE_BIGENDIAN

0 commit comments

Comments
 (0)