Index: src/images/SkImageDecoder_libwebp.cpp |
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp |
index 05925d03a26686c1207644fa4ad991d87644e1f8..4a5951020efd3d35289d23b7d3c496ee1b0517e7 100644 |
--- a/src/images/SkImageDecoder_libwebp.cpp |
+++ b/src/images/SkImageDecoder_libwebp.cpp |
@@ -80,12 +80,13 @@ |
// sanity check for image size that's about to be decoded. |
{ |
- int64_t size = sk_64_mul(*width, *height); |
- if (!sk_64_isS32(size)) { |
+ Sk64 size; |
+ size.setMul(*width, *height); |
+ if (size.isNeg() || !size.is32()) { |
return false; |
} |
// now check that if we are 4-bytes per pixel, we also don't overflow |
- if (sk_64_asS32(size) > (0x7FFFFFFF >> 2)) { |
+ if (size.get32() > (0x7FFFFFFF >> 2)) { |
return false; |
} |
} |