As I keep saying C++ is not C 😁

I know, and I battle for avoiding this confusion. I just see once more that C++ tries to be confusing for C programmers, reproducing syntax but with a whole other lot of constraint that only apply in corner cases 😁

Anyhow, a bad patch could be as simple as:

diff --git a/scintilla/src/Indicator.cxx b/scintilla/src/Indicator.cxx
index f72102772..5c076290b 100644
--- a/scintilla/src/Indicator.cxx
+++ b/scintilla/src/Indicator.cxx
@@ -64,6 +64,8 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
 			const PRectangle rcSquiggle = PixelGridAlign(rc);
 
 			const int width = std::min(4000, static_cast<int>(rcSquiggle.Width()));
+			if (width < 1)
+				break;
 			RGBAImage image(width, 3, 1.0, nullptr);
 			enum { alphaFull = 0xff, alphaSide = 0x2f, alphaSide2=0x5f };
 			for (int x = 0; x < width; x++) {

It solves the very problem here, but doesn't fix it more generally than just for the squiggles.

Unfortunately just fixing the pixels retrieval is not enough, there's at least one other instance of an empty vector access down the same code path.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.