summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-03-12 13:11:03 +0000
committerRobin Watts <robin.watts@artifex.com>2012-03-12 13:29:05 +0000
commit65ca742ba4aabda2768ba4423eeaf06d5d46c76e (patch)
treebeec4f1df024e5b434daf0030a3daa5eb3c5ce16 /pdf
parentcfe5b48198b2f56049fcebad5c422c61fea9e97f (diff)
downloadmupdf-65ca742ba4aabda2768ba4423eeaf06d5d46c76e.tar.xz
Fix bitshifting by a negative amount in PS functions
When bitshifting by a negative amount, we should shift right; thanks to Sebras' work in this area, I spotted that we are attempting to shift right by a negative number.
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_function.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pdf/pdf_function.c b/pdf/pdf_function.c
index a6941ca1..b02ae3c5 100644
--- a/pdf/pdf_function.c
+++ b/pdf/pdf_function.c
@@ -369,7 +369,7 @@ ps_run(fz_context *ctx, psobj *code, ps_stack *st, int pc)
if (i2 > 0 && i2 < 8 * sizeof (i2))
ps_push_int(st, i1 << i2);
else if (i2 < 0 && i2 > -8 * sizeof (i2))
- ps_push_int(st, (int)((unsigned int)i1 >> i2));
+ ps_push_int(st, (int)((unsigned int)i1 >> -i2));
else
ps_push_int(st, i1);
break;