Skip to content

Commit

Permalink
Fix possible crosh on very large images
Browse files Browse the repository at this point in the history
  • Loading branch information
KrokusPokus committed Jun 3, 2024
1 parent 57ac9bc commit 43cce7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JPEGView/XMMImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CXMMImage::CXMMImage(int nWidth, int nHeight, int nFirstX, int nLastX, int nFirs

if (m_pMemory != NULL) {
int nSrcLineWidthPadded = Helpers::DoPadding(nWidth * nChannels, 4);
const uint8* pSrc = (uint8*)pDIB + nFirstY*nSrcLineWidthPadded + nFirstX*nChannels;
const uint8* pSrc = (uint8*)pDIB + (long long)nFirstY*(long long)nSrcLineWidthPadded + (long long)nFirstX*(long long)nChannels;
uint16* pDst = (unsigned short*) m_pMemory;
for (int j = 0; j < nSectionHeight; j++) {
if (nChannels == 4) {
Expand Down

0 comments on commit 43cce7e

Please sign in to comment.