summaryrefslogtreecommitdiff
path: root/src/cairo-truetype-subset.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-08-08 00:54:54 -0400
committerBehdad Esfahbod <behdad@behdad.org>2008-08-08 03:01:17 -0400
commit849159ddd15b21b4feee05aebe82b3acfd94ba38 (patch)
tree32c3438e04704392f2b6f8d1972b8adee0fa2cec /src/cairo-truetype-subset.c
parent178789c37a2a6edaba14a453817b3f9338eab1bd (diff)
[truetype] Fix gcc warning about possibly-infinite-loops
Diffstat (limited to 'src/cairo-truetype-subset.c')
-rw-r--r--src/cairo-truetype-subset.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index 53d72320..892ce412 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -1245,12 +1245,13 @@ _cairo_truetype_reverse_cmap (cairo_scaled_font_t *scaled_font,
uint16_t g_id_be = cpu_to_be16 (index);
int j;
- for (j = 0; j < range_size; j++) {
- if (glyph_ids[j] == g_id_be) {
- *ucs4 = be16_to_cpu (start_code[i]) + j;
- goto found;
+ if (range_size > 0)
+ for (j = 0; j < range_size; j++) {
+ if (glyph_ids[j] == g_id_be) {
+ *ucs4 = be16_to_cpu (start_code[i]) + j;
+ goto found;
+ }
}
- }
}
}