summaryrefslogtreecommitdiffstats
path: root/media/libwebp/utils/rescaler_utils.c
diff options
context:
space:
mode:
authorJustOff <Off.Just.Off@gmail.com>2018-06-29 20:57:44 +0300
committerJustOff <Off.Just.Off@gmail.com>2018-06-29 20:57:44 +0300
commit47e9f9d4c1674cb3ee3bf29c415141520225243d (patch)
tree8b51f96dd85bb3253c0c61fa2b214465d53a95ed /media/libwebp/utils/rescaler_utils.c
parent445ebe5a302895418ba993943de136449c743403 (diff)
downloadUXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar
UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar.gz
UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar.lz
UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar.xz
UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.zip
Sync libwebp sources with https://chromium.googlesource.com/webm/libwebp/+/v1.0.0
Diffstat (limited to 'media/libwebp/utils/rescaler_utils.c')
-rw-r--r--media/libwebp/utils/rescaler_utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/media/libwebp/utils/rescaler_utils.c b/media/libwebp/utils/rescaler_utils.c
index 0d1f80da2..6e384f507 100644
--- a/media/libwebp/utils/rescaler_utils.c
+++ b/media/libwebp/utils/rescaler_utils.c
@@ -15,7 +15,7 @@
#include <stdlib.h>
#include <string.h>
#include "../dsp/dsp.h"
-#include "./rescaler_utils.h"
+#include "../utils/rescaler_utils.h"
//------------------------------------------------------------------------------
@@ -85,11 +85,13 @@ int WebPRescalerGetScaledDimensions(int src_width, int src_height,
// if width is unspecified, scale original proportionally to height ratio.
if (width == 0) {
- width = (src_width * height + src_height / 2) / src_height;
+ width =
+ (int)(((uint64_t)src_width * height + src_height / 2) / src_height);
}
// if height is unspecified, scale original proportionally to width ratio.
if (height == 0) {
- height = (src_height * width + src_width / 2) / src_width;
+ height =
+ (int)(((uint64_t)src_height * width + src_width / 2) / src_width);
}
// Check if the overall dimensions still make sense.
if (width <= 0 || height <= 0) {