Fix error scaling thumbnails to zero dimensions
Follow up to fix for T89868.
This commit is contained in:
parent
06317ce957
commit
5f156291cd
Notes:
blender-bot
2023-02-13 22:19:21 +01:00
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue