From b44e2ab52b810700a9b51b9c0bde06a47ea45cb2 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 8 May 2024 13:26:41 +0200 Subject: [PATCH] AVCBin: avoid integer overflow (fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68814) --- ogr/ogrsf_frmts/avc/ogravcbinlayer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ogr/ogrsf_frmts/avc/ogravcbinlayer.cpp b/ogr/ogrsf_frmts/avc/ogravcbinlayer.cpp index 1705714a1243..f2e9bf93b96b 100644 --- a/ogr/ogrsf_frmts/avc/ogravcbinlayer.cpp +++ b/ogr/ogrsf_frmts/avc/ogravcbinlayer.cpp @@ -31,6 +31,7 @@ #include "cpl_conv.h" #include "cpl_string.h" +#include #include /************************************************************************/ @@ -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