| line |
true |
false |
branch |
|
30
|
0 |
0 |
for (i = 0; i < nwords; i++) { |
|
34
|
0 |
0 |
if (offset < len) word |= (uint32_t)data[offset] << 24; |
|
35
|
0 |
0 |
if (offset + 1 < len) word |= (uint32_t)data[offset + 1] << 16; |
|
36
|
0 |
0 |
if (offset + 2 < len) word |= (uint32_t)data[offset + 2] << 8; |
|
37
|
0 |
0 |
if (offset + 3 < len) word |= (uint32_t)data[offset + 3]; |
|
57
|
0 |
0 |
if (!map) return NULL; |
|
61
|
0 |
0 |
if (!map->old_to_new || !map->new_to_old) { |
|
|
0 |
0 |
if (!map->old_to_new || !map->new_to_old) { |
|
76
|
0 |
0 |
for (i = 1; i < ttf->num_glyphs; i++) { |
|
80
|
0 |
0 |
if (ttf->used_glyphs[byte] & bit) { |
|
92
|
0 |
0 |
if (!map) return; |
|
107
|
0 |
0 |
if (glyph_id >= ttf->num_glyphs) return 0; |
|
111
|
0 |
0 |
if (ttf->index_to_loc_format == 0) { |
|
138
|
0 |
0 |
if (!result) return NULL; |
|
141
|
0 |
0 |
if (!result->offsets) { |
|
150
|
0 |
0 |
for (i = 0; i < map->new_count; i++) { |
|
153
|
0 |
0 |
if (get_glyph_location(ttf, old_id, &off, &len)) { |
|
156
|
0 |
0 |
if (len % 2) total++; /* Pad to even */ |
|
160
|
0 |
0 |
result->data = calloc(1, total > 0 ? total : 1); |
|
162
|
0 |
0 |
if (!result->data) { |
|
172
|
0 |
0 |
for (i = 0; i < map->new_count; i++) { |
|
178
|
0 |
0 |
if (get_glyph_location(ttf, old_id, &off, &len) && len > 0) { |
|
|
0 |
0 |
if (get_glyph_location(ttf, old_id, &off, &len) && len > 0) { |
|
181
|
0 |
0 |
if (len % 2) pos++; /* Pad to even */ |
|
192
|
0 |
0 |
if (!r) return; |
|
208
|
0 |
0 |
if (short_format) { |
|
212
|
0 |
0 |
if (!data) return NULL; |
|
214
|
0 |
0 |
for (i = 0; i < count; i++) { |
|
221
|
0 |
0 |
if (!data) return NULL; |
|
223
|
0 |
0 |
for (i = 0; i < count; i++) { |
|
243
|
0 |
0 |
if (!data) return NULL; |
|
247
|
0 |
0 |
for (i = 0; i < map->new_count; i++) { |
|
251
|
0 |
0 |
if (old_id < ttf->num_h_metrics) { |
|
260
|
0 |
0 |
if (ttf->hmtx.offset + lsb_offset + 2 <= ttf->data_len) { |
|
293
|
0 |
0 |
if (!data) return NULL; |
|
354
|
0 |
0 |
if (ttf->head.length < 54) return NULL; |
|
357
|
0 |
0 |
if (!data) return NULL; |
|
378
|
0 |
0 |
if (!data) return NULL; |
|
396
|
0 |
0 |
if (!data) return NULL; |
|
415
|
0 |
0 |
if (!data) return NULL; |
|
455
|
0 |
0 |
if (!ttf || !out_buf) return PDFMAKE_EINVAL; |
|
|
0 |
0 |
if (!ttf || !out_buf) return PDFMAKE_EINVAL; |
|
460
|
0 |
0 |
if (!map) return PDFMAKE_ENOMEM; |
|
464
|
0 |
0 |
if (!glyf) { free_glyph_map(map); return PDFMAKE_ENOMEM; } |
|
477
|
0 |
0 |
if (!loca || !hmtx || !cmap || !head || !maxp || !hhea || !post) { |
|
|
0 |
0 |
if (!loca || !hmtx || !cmap || !head || !maxp || !hhea || !post) { |
|
|
0 |
0 |
if (!loca || !hmtx || !cmap || !head || !maxp || !hhea || !post) { |
|
|
0 |
0 |
if (!loca || !hmtx || !cmap || !head || !maxp || !hhea || !post) { |
|
|
0 |
0 |
if (!loca || !hmtx || !cmap || !head || !maxp || !hhea || !post) { |
|
|
0 |
0 |
if (!loca || !hmtx || !cmap || !head || !maxp || !hhea || !post) { |
|
|
0 |
0 |
if (!loca || !hmtx || !cmap || !head || !maxp || !hhea || !post) { |
|
495
|
0 |
0 |
if (!result) { |
|
509
|
0 |
0 |
while (power * 2 <= num_tables) { power *= 2; selector++; } |
|
527
|
0 |
0 |
for (i = 0; i < num_tables; i++) { |
|
541
|
0 |
0 |
for (i = 0; i < num_tables; i++) { |
|
542
|
0 |
0 |
if (tables[i].tag == TAG('h','e','a','d')) { |