From de2a36505a9656c6abcd01d3f914a644175a4ced Mon Sep 17 00:00:00 2001 From: elasota Date: Sat, 25 Aug 2018 16:39:43 -0400 Subject: Fix mipmap levels not being initialized --- modules/squish/image_compress_squish.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/squish') diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index 653dd82351..bb8a4bdbea 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -193,8 +193,8 @@ void image_compress_squish(Image *p_image, float p_lossy_quality, Image::Compres int src_ofs = p_image->get_mipmap_offset(i); squish::CompressImage(&rb[src_ofs], w, h, &wb[dst_ofs], squish_comp); dst_ofs += (MAX(4, bw) * MAX(4, bh)) >> shift; - w >>= 1; - h >>= 1; + w = MAX(w / 2, 1); + h = MAX(h / 2, 1); } rb = PoolVector::Read(); -- cgit v1.2.3