summaryrefslogtreecommitdiff
path: root/pdf/pdf_cmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'pdf/pdf_cmap.c')
-rw-r--r--pdf/pdf_cmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pdf/pdf_cmap.c b/pdf/pdf_cmap.c
index 4430979c..587b82e2 100644
--- a/pdf/pdf_cmap.c
+++ b/pdf/pdf_cmap.c
@@ -483,11 +483,12 @@ pdf_lookup_cmap_full(pdf_cmap *cmap, int cpt, int *out)
* multi-byte encoded string.
*/
unsigned char *
-pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, int *cpt)
+pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, int *cpt, int *w)
{
int k, n, c;
c = 0;
+ *w = 0;
for (n = 0; n < 4; n++)
{
c = (c << 8) | buf[n];
@@ -498,6 +499,7 @@ pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, int *cpt)
if (c >= cmap->codespace[k].low && c <= cmap->codespace[k].high)
{
*cpt = c;
+ *w = n + 1;
return buf + n + 1;
}
}