Merge branch 'fdselect-range' into 'master'

Range-check FDSelect value

See merge request cairo/cairo!660
This commit is contained in:
Uli Schlachter 2026-04-24 14:21:53 +00:00
commit c85d74aa5a

View file

@ -1876,6 +1876,10 @@ cairo_cff_font_subset_fontdict (cairo_cff_font_t *font)
}
fd = font->fdselect[gid];
if (fd < 0 || (unsigned int) fd >= font->num_fontdicts) {
free (reverse_map);
return CAIRO_INT_STATUS_UNSUPPORTED;
}
if (reverse_map[fd] < 0) {
font->fd_subset_map[font->num_subset_fontdicts] = fd;
reverse_map[fd] = font->num_subset_fontdicts++;