# HG changeset patch # User Sebastien Jodogne # Date 1645269461 -3600 # Node ID d8c8274d4e4175e6355321a7e4c5141104670ea6 # Parent 8523078f3f4b7cba603949aabf30dd838371513d cppcheck diff -r 8523078f3f4b -r d8c8274d4e41 OrthancFramework/Sources/Images/ImageProcessing.cpp --- a/OrthancFramework/Sources/Images/ImageProcessing.cpp Fri Feb 18 15:45:28 2022 +0100 +++ b/OrthancFramework/Sources/Images/ImageProcessing.cpp Sat Feb 19 12:17:41 2022 +0100 @@ -2059,14 +2059,16 @@ if (onlyHorizontalSegments) { // Degenerate case: There are only horizontal lines. If this is - // the case, "GetPolygonPreviousY()" will be an infinite loop + // the case, "GetPolygonPreviousY()" would be an infinite loop int x1 = points[0].GetX(); - int x2 = points[0].GetX(); + int x2 = x1; for (size_t i = 1; i < points.size(); i++) { assert(points[i].GetY() == points[0].GetY()); - x1 = std::min(x1, points[i].GetX()); - x2 = std::max(x2, points[i].GetX()); + + const int x = points[i].GetX(); + x1 = std::min(x1, x); + x2 = std::max(x2, x); } filler.Fill(points[0].GetY(), x1, x2); return; diff -r 8523078f3f4b -r d8c8274d4e41 OrthancServer/Resources/RunCppCheck.sh --- a/OrthancServer/Resources/RunCppCheck.sh Fri Feb 18 15:45:28 2022 +0100 +++ b/OrthancServer/Resources/RunCppCheck.sh Sat Feb 19 12:17:41 2022 +0100 @@ -26,7 +26,7 @@ syntaxError:../../OrthancServer/UnitTestsSources/UnitTestsMain.cpp:322 uninitMemberVar:../../OrthancServer/Sources/ServerJobs/StorageCommitmentScpJob.cpp:428 unreadVariable:../../OrthancFramework/Sources/FileStorage/StorageAccessor.cpp -unreadVariable:../../OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp:1125 +unreadVariable:../../OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp:1127 unusedFunction useInitializationList:../../OrthancFramework/Sources/Images/PngReader.cpp:90 useInitializationList:../../OrthancFramework/Sources/Images/PngWriter.cpp:98