From 9fbd2de7411f6c87c6f1ad0d9adfba9fe5164e0f Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 20 Apr 2012 15:45:09 +0100 Subject: 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. --- draw/draw_affine.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'draw') 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); -- cgit v1.2.3