mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-02 02:38:07 +02:00
Subsetting: Add check for malloc() error
This commit is contained in:
parent
27312591fe
commit
a1e5b91588
1 changed files with 5 additions and 4 deletions
|
|
@ -341,11 +341,12 @@ _cairo_sub_font_collect (void *entry, void *closure)
|
|||
/* No need to check for out of memory here. If to_unicode is NULL, the PDF
|
||||
* surface does not emit an ToUnicode stream */
|
||||
subset.to_unicode = malloc (collection->num_glyphs*sizeof(unsigned long));
|
||||
for (j = 0; j < collection->num_glyphs; j++) {
|
||||
/* default unicode character required when mapping fails */
|
||||
subset.to_unicode[j] = 0xfffd;
|
||||
if (subset.to_unicode) {
|
||||
for (j = 0; j < collection->num_glyphs; j++) {
|
||||
/* default unicode character required when mapping fails */
|
||||
subset.to_unicode[j] = 0xfffd;
|
||||
}
|
||||
}
|
||||
|
||||
(collection->font_subset_callback) (&subset,
|
||||
collection->font_subset_callback_closure);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue