[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pdf-devel] Divison by zero in type 4 functions
From: |
David Vazquez |
Subject: |
Re: [pdf-devel] Divison by zero in type 4 functions |
Date: |
Wed, 04 Feb 2009 16:01:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
address@hidden writes:
> Hi all,
>
> If I understand correctly the following lines (1498 and 1511) from
> pdf-fp-func.c
> aren't considering the case when "stack[sp] == 0".
> ##
> case OPC_div:
> if (sp < 1) goto stack_underflow;
> stack[sp-1] /= stack[sp];
> sp--;
> break;
>
> [...]
>
> case OPC_idiv:
> if (sp < 1) goto stack_underflow;
> if (!INT_P(stack[sp]) || !INT_P(stack[sp-1]))
> goto type_error;
> stack[sp-1] = INT(stack[sp]) / INT(stack[sp-1]);
> sp--;
> break;
> ###
>
>
> Is that a bug ?
>
Hi gerel,
It seems. I think there is similar errors (e.g: sqrt operand works on
real numbers and it does not check their parameter to be non-negative).
I am working on error management in type 4 functions. I think it would
be better finish this task first. Then, we can take a look to these
commands in the Postscript language reference, and check to it handles
errors correctly.