1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Update libwebp to 1.0.3

This commit is contained in:
volzhs
2019-10-27 21:29:43 +09:00
parent 9e572b5bac
commit 074d421dca
40 changed files with 454 additions and 332 deletions

View File

@@ -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) {