From 75161c24c1e760e3b2bfcde8b0e1bd13524ce120 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 13 Jan 2007 00:02:37 +0000 Subject: [PATCH] Fix for bug #5694: Another issue with division by zero in texture paint, this time in torus wrapping. --- source/blender/imbuf/intern/rectop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c index 429fcb109ea..bf459524c80 100644 --- a/source/blender/imbuf/intern/rectop.c +++ b/source/blender/imbuf/intern/rectop.c @@ -450,6 +450,9 @@ void IMB_rectblend_torus(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx, { int origw, origh, w, h; + if (dbuf->x == 0 || dbuf->y == 0 || sbuf->x == 0 || sbuf->y == 0) + return; + /* convert destination and source coordinates too be withing image */ destx = destx % dbuf->x; if (destx < 0) destx += dbuf->x;