summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorelasota <ejlasota@gmail.com>2018-08-25 16:39:43 -0400
committerelasota <ejlasota@gmail.com>2018-08-25 17:22:53 -0400
commitde2a36505a9656c6abcd01d3f914a644175a4ced (patch)
tree113d4538556328e490412f985c563a0bbc7f77ed /modules
parentf72f74486d3f07b2be0c6480c6c0d34edd47794f (diff)
Fix mipmap levels not being initialized
Diffstat (limited to 'modules')
-rw-r--r--modules/cvtt/image_compress_cvtt.cpp4
-rw-r--r--modules/squish/image_compress_squish.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/cvtt/image_compress_cvtt.cpp b/modules/cvtt/image_compress_cvtt.cpp
index 3a371c8597..af92861352 100644
--- a/modules/cvtt/image_compress_cvtt.cpp
+++ b/modules/cvtt/image_compress_cvtt.cpp
@@ -247,8 +247,8 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::CompressS
}
dst_ofs += (MAX(4, bw) * MAX(4, bh)) >> shift;
- w >>= 1;
- h >>= 1;
+ w = MAX(w / 2, 1);
+ h = MAX(h / 2, 1);
}
if (num_job_threads > 0) {
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<uint8_t>::Read();