mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix error scaling thumbnails to zero dimensions
Follow up to fix for T89868.
This commit is contained in:
parent
d6facd44b5
commit
16637e7ff4
1 changed files with 3 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue