summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_cmap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pdf/pdf_cmap.c b/pdf/pdf_cmap.c
index 67626b31..0b5e4645 100644
--- a/pdf/pdf_cmap.c
+++ b/pdf/pdf_cmap.c
@@ -204,6 +204,12 @@ add_table(fz_context *ctx, pdf_cmap *cmap, int value)
static void
add_range(fz_context *ctx, pdf_cmap *cmap, int low, int high, int flag, int offset)
{
+ /* Sanity check ranges */
+ if (low < 0 || low > 65535 || high < 0 || high > 65535 || low > high)
+ {
+ fz_warn(ctx, "range limits out of range in cmap %s", cmap->cmap_name);
+ return;
+ }
/* If the range is too large to be represented, split it */
if (high - low > 0x3fff)
{
@@ -276,7 +282,7 @@ pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, int low, int *values, int l
values[0] >= 0xD800 && values[0] <= 0xDBFF &&
values[1] >= 0xDC00 && values[1] <= 0xDFFF)
{
- fz_warn(ctx, "ignoring surrogate pair mapping in cmap");
+ fz_warn(ctx, "ignoring surrogate pair mapping in cmap %s", cmap->cmap_name);
return;
}