aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PerLine.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/PerLine.cxx b/src/PerLine.cxx
index f8989691d..e2e892d76 100644
--- a/src/PerLine.cxx
+++ b/src/PerLine.cxx
@@ -188,11 +188,14 @@ int LineMarkers::AddMark(int line, int markerNum, int lines) {
// No existing markers so allocate one element per line
markers.InsertValue(0, lines, 0);
}
+ if (line >= markers.Length()) {
+ return -1;
+ }
if (!markers[line]) {
// Need new structure to hold marker handle
markers[line] = new MarkerHandleSet();
if (!markers[line])
- return - 1;
+ return -1;
}
markers[line]->InsertHandle(handleCurrent, markerNum);