diff options
author | volzhs <volzhs@gmail.com> | 2019-10-27 21:29:43 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2019-10-27 21:29:43 +0900 |
commit | 074d421dca94ec4ddadfbfa62268bda219bab46c (patch) | |
tree | acec76662c787a9275c04d437fd463734ae5d4dd /thirdparty/libwebp/src/utils/rescaler_utils.c | |
parent | 9e572b5bacdaeb5079415d276bbf5b8462cac9e3 (diff) | |
download | redot-engine-074d421dca94ec4ddadfbfa62268bda219bab46c.tar.gz |
Update libwebp to 1.0.3
Diffstat (limited to 'thirdparty/libwebp/src/utils/rescaler_utils.c')
-rw-r--r-- | thirdparty/libwebp/src/utils/rescaler_utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/thirdparty/libwebp/src/utils/rescaler_utils.c b/thirdparty/libwebp/src/utils/rescaler_utils.c index 90e2ea76a1..4bcae24af5 100644 --- a/thirdparty/libwebp/src/utils/rescaler_utils.c +++ b/thirdparty/libwebp/src/utils/rescaler_utils.c @@ -84,14 +84,14 @@ int WebPRescalerGetScaledDimensions(int src_width, int src_height, int height = *scaled_height; // if width is unspecified, scale original proportionally to height ratio. - if (width == 0) { + if (width == 0 && src_height > 0) { width = - (int)(((uint64_t)src_width * height + src_height / 2) / src_height); + (int)(((uint64_t)src_width * height + src_height - 1) / src_height); } // if height is unspecified, scale original proportionally to width ratio. - if (height == 0) { + if (height == 0 && src_width > 0) { height = - (int)(((uint64_t)src_height * width + src_width / 2) / src_width); + (int)(((uint64_t)src_height * width + src_width - 1) / src_width); } // Check if the overall dimensions still make sense. if (width <= 0 || height <= 0) { |