summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-11-30 11:59:48 +0000
committerRobin Watts <robin.watts@artifex.com>2012-12-13 12:10:36 +0000
commite1d2edc18d76259dd70209fecb8bdab4700918e8 (patch)
tree7ec4b9621176b9ef9fd46bae1072e1241a38923a /pdf
parent709a75126bc3639205d4c5e9fcbf788721ae43c2 (diff)
downloadmupdf-e1d2edc18d76259dd70209fecb8bdab4700918e8.tar.xz
Bug 693290: PDF cmap range warnings
Thanks to zeniko for these.
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;
}