r22494 by jghali - #15279: Warning: Array index used before limits check

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 29 01:07:45 UTC 2018


Author: jghali
Date: Sun Apr 29 01:07:45 2018
New Revision: 22494

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22494
Log:
#15279: Warning: Array index used before limits check

Modified:
    trunk/Scribus/scribus/third_party/lib2geom/piecewise.h

Modified: trunk/Scribus/scribus/third_party/lib2geom/piecewise.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22494&path=/trunk/Scribus/scribus/third_party/lib2geom/piecewise.h
==============================================================================
--- trunk/Scribus/scribus/third_party/lib2geom/piecewise.h	(original)
+++ trunk/Scribus/scribus/third_party/lib2geom/piecewise.h	Sun Apr 29 01:07:45 2018
@@ -291,7 +291,7 @@
     unsigned si = 0, ci = 0;     //Segment index, Cut index
 
     //if the cuts have something earlier than the Piecewise<T>, add portions of the first segment
-    while(c[ci] < pw.cuts.front() && ci < c.size()) {
+    while(ci < c.size() && c[ci] < pw.cuts.front()) {
         bool isLast = (ci == c.size()-1 || c[ci + 1] >= pw.cuts.front());
         ret.push_cut(c[ci]);
         ret.push_seg( elem_portion(pw, 0, c[ci], isLast ? pw.cuts.front() : c[ci + 1]) );




More information about the scribus-commit mailing list