From fdceee008867179e36028853d85356c034f48e23 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 6 Apr 2009 09:05:37 +0000 Subject: Bugfix #18266 Mipmap creation for render crashed, in this case: - use Curves tool on an Image, which is UV mapped on object - Save the image to disk, under new name - Render (F12) This fix is only for the crash, there's something not well coded for Curves tool, how it manages float buffers. That's for 2.5. --- source/blender/imbuf/intern/scaling.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/imbuf/intern/scaling.c') diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 8257eb4643e..807b0c84e90 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -299,7 +299,6 @@ struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1) if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); do_rect= (ibuf1->rect != NULL); - do_float= (ibuf1->rect_float != NULL); if (ibuf1->x <= 1) return(IMB_half_y(ibuf1)); if (ibuf1->y <= 1) return(IMB_half_x(ibuf1)); @@ -312,6 +311,8 @@ struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1) p1 = (uchar *) ibuf1->rect; dest=(uchar *) ibuf2->rect; + do_float= (ibuf1->rect_float != NULL && ibuf2->rect_float != NULL); + for(y=ibuf2->y;y>0;y--){ if (do_rect) p2 = p1 + (ibuf1->x << 2); if (do_float) p2f = p1f + (ibuf1->x << 2); -- cgit v1.2.3