summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-04-20 15:45:09 +0100
committerRobin Watts <robin.watts@artifex.com>2012-04-20 15:45:09 +0100
commit9fbd2de7411f6c87c6f1ad0d9adfba9fe5164e0f (patch)
treeacbf3555988babdd4bd37b0e218a6d384676a07e /draw
parent69849ca6b0eb3db01bccf2b1c329b7b0787398df (diff)
downloadmupdf-9fbd2de7411f6c87c6f1ad0d9adfba9fe5164e0f.tar.xz
Bug 692995: Fix hang when rendering image.
Once the shape was combined with the image in the file in question the width/height drop to be below zero. Detect this case and bale. File rendering looks fine.
Diffstat (limited to 'draw')
-rw-r--r--draw/draw_affine.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/draw/draw_affine.c b/draw/draw_affine.c
index 483fcfd2..4e21ced0 100644
--- a/draw/draw_affine.c
+++ b/draw/draw_affine.c
@@ -645,6 +645,8 @@ fz_paint_image_imp(fz_pixmap *dst, fz_bbox scissor, fz_pixmap *shape, fz_pixmap
if (shape && shape->y + shape->h < h)
h = shape->y + shape->h;
h -= y;
+ if (w < 0 || h < 0)
+ return;
/* map from screen space (x,y) to image space (u,v) */
inv = fz_scale(1.0f / img->w, 1.0f / img->h);