Skip to content

Commit

Permalink
AVCBin: avoid integer overflow (fixes https://bugs.chromium.org/p/oss…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed May 8, 2024
1 parent bb5ea61 commit b44e2ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ogr/ogrsf_frmts/avc/ogravcbinlayer.cpp
Expand Up @@ -31,6 +31,7 @@
#include "cpl_conv.h"
#include "cpl_string.h"

#include <climits>
#include <cstdlib>

/************************************************************************/
Expand Down Expand Up @@ -277,8 +278,11 @@ bool OGRAVCBinLayer::FormPolygonGeometry(OGRFeature *poFeature, AVCPal *psPAL)

for (int iArc = 0; iArc < psPAL->numArcs; iArc++)
{
if (psPAL->pasArcs[iArc].nArcId == 0)
if (psPAL->pasArcs[iArc].nArcId == 0 ||
psPAL->pasArcs[iArc].nArcId == INT_MIN)
{
continue;
}

// If the other side of the line is the same polygon then this
// arc is a "bridge" arc and can be discarded. If we don't discard
Expand Down

0 comments on commit b44e2ab

Please sign in to comment.