Skip to content

Commit

Permalink
check for 0 width/height
Browse files Browse the repository at this point in the history
  • Loading branch information
qbnu committed Jun 12, 2024
1 parent bd7bb2b commit 6529fe9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JPEGView/PSDWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ CJPEGImage* PsdReader::ReadImage(LPCTSTR strFileName, bool& bOutOfMemory)
if ((double)nHeight * nWidth > MAX_IMAGE_PIXELS) {
bOutOfMemory = true;
}
ThrowIf(bOutOfMemory || nHeight > MAX_IMAGE_DIMENSION || nWidth > MAX_IMAGE_DIMENSION);
ThrowIf(bOutOfMemory || max(nHeight, nWidth) > MAX_IMAGE_DIMENSION || !min(nHeight, nWidth));

// PSD can have bit depths of 1, 2, 4, 8, 16, 32
unsigned short nBitDepth = ReadUShortFromFile(hFile);
Expand Down

0 comments on commit 6529fe9

Please sign in to comment.