Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-02-11 14:11:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-02-11 14:12:37 +0300
commitd2ff21e75de906d90f3d338871ca35756e94bfea (patch)
treedcc83652ea378e2e442d75570f07fa67ec0b5c77
parent3a1af7444c36df7a3bd0ffcd8566c52136b14629 (diff)
Fix memory leak with 2D image painting
Regression from c30d6571bb477
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index 7f71110b360..a667c7062e6 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -1646,7 +1646,7 @@ void paint_2d_stroke(void *ps,
continue;
}
- ImBuf *ibuf = BKE_image_acquire_ibuf(s->image, &tile->iuser, NULL);
+ ImBuf *ibuf = tile->canvas;
/* OCIO_TODO: float buffers are now always linear, so always use color correction
* this should probably be changed when texture painting color space is supported
@@ -1711,6 +1711,7 @@ void *paint_2d_new_stroke(bContext *C, wmOperator *op, int mode)
}
if (ibuf->channels != 4) {
+ BKE_image_release_ibuf(s->image, ibuf, NULL);
BKE_report(op->reports, RPT_WARNING, "Image requires 4 color channels to paint");
MEM_freeN(s->tiles);
MEM_freeN(s);