[Bf-blender-cvs] [8c3c669] master: Image Paint: fix for calls to GPU_free_image while painting

Campbell Barton noreply at git.blender.org
Thu May 5 10:48:21 CEST 2016


Commit: 8c3c669c2d6f342bc27b0c8b130f8518f6b432f4
Author: Campbell Barton
Date:   Thu May 5 18:52:11 2016 +1000
Branches: master
https://developer.blender.org/rB8c3c669c2d6f342bc27b0c8b130f8518f6b432f4

Image Paint: fix for calls to GPU_free_image while painting

The width and height of of the region to update are often zero,
skip calling GPU_paint_update_image in this case.

===================================================================

M	source/blender/editors/sculpt_paint/paint_image.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index a9cd601..4dd521e 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -498,8 +498,10 @@ void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, short te
 	if (texpaint || (sima && sima->lock)) {
 		int w = imapaintpartial.x2 - imapaintpartial.x1;
 		int h = imapaintpartial.y2 - imapaintpartial.y1;
-		/* Testing with partial update in uv editor too */
-		GPU_paint_update_image(image, (sima ? &sima->iuser : NULL), imapaintpartial.x1, imapaintpartial.y1, w, h); //!texpaint);
+		if (w && h) {
+			/* Testing with partial update in uv editor too */
+			GPU_paint_update_image(image, (sima ? &sima->iuser : NULL), imapaintpartial.x1, imapaintpartial.y1, w, h);
+		}
 	}
 }




More information about the Bf-blender-cvs mailing list