summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-cmap-load.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-05-13 14:41:48 +0200
committerTor Andersson <tor.andersson@artifex.com>2014-05-13 14:44:18 +0200
commit9f510df7318ff4fc12ed4d35bd0454d5a8ddbd88 (patch)
treec1f49157265351245610e28b561a48cace8f46c3 /source/pdf/pdf-cmap-load.c
parent4a1d6f9886c141e165c281f127c0cb387c6407d6 (diff)
downloadmupdf-9f510df7318ff4fc12ed4d35bd0454d5a8ddbd88.tar.xz
Use code space ranges when remapping ToUnicode CMaps.
Diffstat (limited to 'source/pdf/pdf-cmap-load.c')
-rw-r--r--source/pdf/pdf-cmap-load.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/pdf/pdf-cmap-load.c b/source/pdf/pdf-cmap-load.c
index d3f17c35..ec27eddd 100644
--- a/source/pdf/pdf-cmap-load.c
+++ b/source/pdf/pdf-cmap-load.c
@@ -105,9 +105,10 @@ pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes)
pdf_cmap *cmap = pdf_new_cmap(ctx);
fz_try(ctx)
{
+ unsigned int high = (1 << (bytes * 8)) - 1;
sprintf(cmap->cmap_name, "Identity-%c", wmode ? 'V' : 'H');
- pdf_add_codespace(ctx, cmap, 0x0000, 0xffff, bytes);
- pdf_map_range_to_range(ctx, cmap, 0x0000, 0xffff, 0);
+ pdf_add_codespace(ctx, cmap, 0, high, bytes);
+ pdf_map_range_to_range(ctx, cmap, 0, high, 0);
pdf_sort_cmap(ctx, cmap);
pdf_set_cmap_wmode(ctx, cmap, wmode);
}