File tree Expand file tree Collapse file tree 1 file changed +6
-28
lines changed
Expand file tree Collapse file tree 1 file changed +6
-28
lines changed Original file line number Diff line number Diff line change @@ -203,8 +203,9 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream)
203203 /* Step thru the coutours. */
204204 /* I believe that a contour is a detatched */
205205 /* set of curves and lines. */
206- i=j=k=0 ;
207- while ( i < num_ctr )
206+ for (i = j = k = 0 ;
207+ i != NOMOREOUTCTR && i < num_ctr;
208+ k = nextinctr (i, k), (k == NOMOREINCTR && (i = k = nextoutctr (i))))
208209 {
209210 // A TrueType contour consists of on-path and off-path points.
210211 // Two consecutive on-path points are to be joined with a
@@ -224,24 +225,13 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream)
224225 }
225226 }
226227
227- // For any two consecutive off-path points, insert the implied
228- // on-path point.
229-
230228 if (points.size () == 0 ) {
231- k=nextinctr (i,k);
232-
233- if (k==NOMOREINCTR)
234- {
235- i=k=nextoutctr (i);
236- }
237-
238- if (i==NOMOREOUTCTR)
239- {
240- break ;
241- }
229+ // Don't try to access the last element of an empty list
242230 continue ;
243231 }
244232
233+ // For any two consecutive off-path points, insert the implied
234+ // on-path point.
245235 FlaggedPoint prev = points.back ();
246236 for (std::list<FlaggedPoint>::iterator it = points.begin ();
247237 it != points.end ();
@@ -296,18 +286,6 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream)
296286 p += 2 ;
297287 }
298288 }
299-
300- k=nextinctr (i,k);
301-
302- if (k==NOMOREINCTR)
303- {
304- i=k=nextoutctr (i);
305- }
306-
307- if (i==NOMOREOUTCTR)
308- {
309- break ;
310- }
311289 }
312290
313291 /* Now, we can fill the whole thing. */
You can’t perform that action at this time.
0 commit comments