From 58a6f0764916adecb71385cd43b917f1b708b334 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 12 Feb 2013 15:51:05 +0000 Subject: Bug fix #34213 (2) Adding non-RGBA float buffers as texture crashes MipMap code. Images with less than 4 channels not supported (yet). Not sure if we ever should even... normals, Z, vectors, UV, Index, all don't like downsampling. --- source/blender/imbuf/intern/filter.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/imbuf/intern/filter.c') diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c index 51fee232034..9193954f1d6 100644 --- a/source/blender/imbuf/intern/filter.c +++ b/source/blender/imbuf/intern/filter.c @@ -506,6 +506,10 @@ void IMB_makemipmap(ImBuf *ibuf, int use_filter) imb_freemipmapImBuf(ibuf); + /* no mipmap for non RGBA images */ + if (ibuf->rect_float && ibuf->channels < 4) + return; + ibuf->miptot = 1; while (curmap < IB_MIPMAP_LEVELS) { -- cgit v1.2.3