Skip to content

Commit

Permalink
LERC: avoid potential integer overflow (fixes https://github.com/OSGe…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 14, 2025
1 parent f3ecbf9 commit 07a271a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frmts/mrf/LERCV1/Lerc1Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,8 @@ bool Lerc1Image::readZTile(Byte **ppByte, size_t &nRemainingBytes, int r0,
return true;
}

idataVec.resize((r1 - r0) * (c1 - c0)); // max size, gets adjusted
idataVec.resize(static_cast<size_t>(r1 - r0) *
(c1 - c0)); // max size, gets adjusted
if (!blockread(&ptr, nRemainingBytes, idataVec))
return false;

Expand Down

0 comments on commit 07a271a

Please sign in to comment.