File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1203,21 +1203,23 @@ - (void)batchDrawData:(NSData *)data
12031203 CTRunRef run = (CTRunRef)item;
12041204 CFIndex count = CTRunGetGlyphCount (run);
12051205
1206- if (count > 0 && count - offset > length)
1207- count = length - offset;
1208-
1209- CFRange range = CFRangeMake (0 , count);
1210-
1211- if (glyphs != NULL )
1212- CTRunGetGlyphs (run, range, &glyphs[offset]);
1213- if (advances != NULL )
1214- CTRunGetAdvances (run, range, &advances[offset]);
1215- if (positions != NULL )
1216- CTRunGetPositions (run, range, &positions[offset]);
1217-
1218- offset += count;
1219- if (offset >= length)
1220- break ;
1206+ if (count > 0 ) {
1207+ if (count > length - offset)
1208+ count = length - offset;
1209+
1210+ CFRange range = CFRangeMake (0 , count);
1211+
1212+ if (glyphs != NULL )
1213+ CTRunGetGlyphs (run, range, &glyphs[offset]);
1214+ if (advances != NULL )
1215+ CTRunGetAdvances (run, range, &advances[offset]);
1216+ if (positions != NULL )
1217+ CTRunGetPositions (run, range, &positions[offset]);
1218+
1219+ offset += count;
1220+ if (offset >= length)
1221+ break ;
1222+ }
12211223 }
12221224
12231225 return offset;
You can’t perform that action at this time.
0 commit comments