File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
source/matplot/axes_objects Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1019,9 +1019,12 @@ namespace matplot {
1019
1019
} else {
1020
1020
// Skip the next nans separating parents and children
1021
1021
// to avoid extra useless empty lines in case there is
1022
- // more than one nan
1023
- while (is_separator (lines_[i].first [j + 1 ],
1024
- lines_[i].second [j + 1 ])) {
1022
+ // more than one nan (with out-of-bounds check if we
1023
+ // have a corner case then the lines_ has one or more
1024
+ // nans at end of the underlying storage)
1025
+ while (j + 1 < lines_[i].first .size () &&
1026
+ is_separator (lines_[i].first [j + 1 ],
1027
+ lines_[i].second [j + 1 ])) {
1025
1028
++j;
1026
1029
}
1027
1030
// Include an empty line to indicate this polygon or line
@@ -1712,4 +1715,4 @@ namespace matplot {
1712
1715
return *this ;
1713
1716
}
1714
1717
1715
- } // namespace matplot
1718
+ } // namespace matplot
You can’t perform that action at this time.
0 commit comments