summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvipdfmx/src/cff_dict.c
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2008-03-27 11:18:16 +0000
committerJonathan Kew <jfkthame@googlemail.com>2008-03-27 11:18:16 +0000
commita95124f73754f00f40705b40ff513e5f21db45fd (patch)
treed288b3ce80bc10e37bc7bca19ae6698cddd9a5ea /Build/source/texk/xdvipdfmx/src/cff_dict.c
parent194899d8a5ee8f12d82f140c728e1f9dad6c1d04 (diff)
xdvipdfmx update from xetex svn r.633
git-svn-id: svn://tug.org/texlive/trunk@7186 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/xdvipdfmx/src/cff_dict.c')
-rw-r--r--Build/source/texk/xdvipdfmx/src/cff_dict.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/Build/source/texk/xdvipdfmx/src/cff_dict.c b/Build/source/texk/xdvipdfmx/src/cff_dict.c
index e0a6454711d..37a27ef90f9 100644
--- a/Build/source/texk/xdvipdfmx/src/cff_dict.c
+++ b/Build/source/texk/xdvipdfmx/src/cff_dict.c
@@ -301,9 +301,6 @@ static void add_dict (cff_dict *dict,
if (dict_operator[id].opname == NULL || argtype < 0) {
*status = CFF_ERROR_PARSE_ERROR;
return;
- } else if (stack_top < 1) {
- *status = CFF_ERROR_STACK_UNDERFLOW;
- return;
}
if (dict->count >= dict->max) {
@@ -317,20 +314,30 @@ static void add_dict (cff_dict *dict,
argtype == CFF_TYPE_BOOLEAN ||
argtype == CFF_TYPE_SID ||
argtype == CFF_TYPE_OFFSET) {
+ /* check for underflow here, as exactly one operand is expected */
+ if (stack_top < 1) {
+ *status = CFF_ERROR_STACK_UNDERFLOW;
+ return;
+ }
stack_top--;
(dict->entries)[dict->count].count = 1;
(dict->entries)[dict->count].values = NEW(1, double);
(dict->entries)[dict->count].values[0] = arg_stack[stack_top];
+ dict->count += 1;
} else {
- (dict->entries)[dict->count].count = stack_top;
- (dict->entries)[dict->count].values = NEW(stack_top, double);
- while (stack_top > 0) {
- stack_top--;
- (dict->entries)[dict->count].values[stack_top] = arg_stack[stack_top];
+ /* just ignore operator if there were no operands provided;
+ don't treat this as underflow (e.g. StemSnapV in TemporaLGCUni-Italic.otf) */
+ if (stack_top > 0) {
+ (dict->entries)[dict->count].count = stack_top;
+ (dict->entries)[dict->count].values = NEW(stack_top, double);
+ while (stack_top > 0) {
+ stack_top--;
+ (dict->entries)[dict->count].values[stack_top] = arg_stack[stack_top];
+ }
+ dict->count += 1;
}
}
- dict->count += 1;
*data += 1;
return;