summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--raster/meshdraw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/raster/meshdraw.c b/raster/meshdraw.c
index c0d798e6..2c6d2c99 100644
--- a/raster/meshdraw.c
+++ b/raster/meshdraw.c
@@ -358,12 +358,16 @@ fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_colorspace *destcs, fz_pixmap
p.x = shade->mesh[(i * 3 + k) * n + 0];
p.y = shade->mesh[(i * 3 + k) * n + 1];
p = fz_transformpoint(ctm, p);
+ if (isnan(p.y) || isnan(p.x)) // How is this happening?
+ goto baddata;
tri[k][0] = p.x;
tri[k][1] = p.y;
for (j = 2; j < n; j++)
tri[k][j] = shade->mesh[( i * 3 + k) * n + j] * 255;
}
fz_drawtriangle(temp, tri[0], tri[1], tri[2], n);
+ baddata:
+ ;
}
if (shade->usefunction)