[Bf-blender-cvs] [16637e7ff40] blender-v2.93-release: Fix error scaling thumbnails to zero dimensions
Campbell Barton
noreply at git.blender.org
Mon Sep 6 09:40:34 CEST 2021
Commit: 16637e7ff40b4a18c4dc41c87c25079bf396be5f
Author: Campbell Barton
Date: Sat Aug 28 19:57:31 2021 +1000
Branches: blender-v2.93-release
https://developer.blender.org/rB16637e7ff40b4a18c4dc41c87c25079bf396be5f
Fix error scaling thumbnails to zero dimensions
Follow up to fix for T89868.
===================================================================
M source/blender/imbuf/intern/thumbs.c
===================================================================
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 61bc185eb8d..60ad70aa8d8 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -435,8 +435,9 @@ static ImBuf *thumb_create_ex(const char *file_path,
scaledy = (float)tsize;
scaledx = ((float)img->x / (float)img->y) * tsize;
}
- ex = (short)scaledx;
- ey = (short)scaledy;
+ /* Scaling down must never assign zero width/height, see: T89868. */
+ ex = MAX2(1, (short)scaledx);
+ ey = MAX2(1, (short)scaledy);
/* save some time by only scaling byte buf */
if (img->rect_float) {
More information about the Bf-blender-cvs
mailing list