summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2012-06-07 19:18:52 +0930
committerAdrian Johnson <ajohnson@redneon.com>2012-06-07 19:18:52 +0930
commit2f1d6b27e8b78c77346a5b603114b54400e57d83 (patch)
tree013c54aeb9ed0c9b1bb2fa5e5496136af7b749c2
parent9fa047c0ea49d94f9f27947931fe21b70f6463d5 (diff)
cff-subsetting: Ignore charset for non cid fonts
Fixes crash in https://bugzilla.gnome.org/show_bug.cgi?id=677422
-rw-r--r--src/cairo-cff-subset.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index db6fdf736..6f0cd66f3 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -1178,14 +1178,16 @@ cairo_cff_font_read_top_dict (cairo_cff_font_t *font)
goto fail;
font->num_glyphs = _cairo_array_num_elements (&font->charstrings_index);
- operand = cff_dict_get_operands (font->top_dict, CHARSET_OP, &size);
- if (font->is_cid && !operand)
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ if (font->is_cid) {
+ operand = cff_dict_get_operands (font->top_dict, CHARSET_OP, &size);
+ if (!operand)
+ return CAIRO_INT_STATUS_UNSUPPORTED;
- decode_integer (operand, &offset);
- font->charset = font->data + offset;
- if (font->charset >= font->data_end)
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ decode_integer (operand, &offset);
+ font->charset = font->data + offset;
+ if (font->charset >= font->data_end)
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+ }
if (!font->is_opentype)
cairo_cff_font_read_font_metrics (font, font->top_dict);