We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8cb7579 commit c0f9939Copy full SHA for c0f9939
1 file changed
tools/unicode_filter.c
@@ -338,9 +338,21 @@ int main(int argc, char **argv){
338
if(!cmap_record){ fprintf(stderr,"No cmap table.\n"); return 1; }
339
340
uint16_t numSub = r16(buf+cmap_offset+2);
341
+ uint32_t seen_offsets[MAX_RANGES*4];
342
+ int seen_count = 0;
343
for(int i=0;i<numSub;i++){
344
uint8_t *rec = buf+cmap_offset+4+i*8;
345
uint32_t off = r32(rec+4);
346
+
347
+ int already = 0;
348
+ for(int k=0;k<seen_count;k++){
349
+ if(seen_offsets[k]==off){ already=1; break; }
350
+ }
351
+ if(already) continue;
352
+ if(seen_count < (int)(sizeof(seen_offsets)/sizeof(seen_offsets[0]))){
353
+ seen_offsets[seen_count++] = off;
354
355
356
uint8_t *sub = buf+cmap_offset+off;
357
uint16_t fmt = r16(sub);
358
if(fmt==12) rebuild_format12_safe(sub, &list);
0 commit comments