aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2016-10-17 17:43:23 +0000
committerGravatar Matt Sarett <msarett@google.com>2016-10-17 17:43:32 +0000
commitaf017418b369fd14cb009c5f4c82683fb59f6c87 (patch)
treec85e576c7f72fe8ac089b12b090842cff653c9f6 /src/codec
parent5238343ab27a9f42983b6c79f199416a5ae58542 (diff)
Revert "Avoid integer overflow in SkIcoCodec"
This reverts commit 20cba06a4bc9bde60b2dc37907d11ca81ba35ce8. Reason for revert: <INSERT REASONING HERE> TBR=msarett@google.com,scroggo@google.com,kjlubick@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Id8f48a90a7dc620f9c0ee2f419d14bae2b0c1e7e Reviewed-on: https://skia-review.googlesource.com/3564 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/codec')
-rw-r--r--src/codec/SkIcoCodec.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/codec/SkIcoCodec.cpp b/src/codec/SkIcoCodec.cpp
index d01904dc1b..63b72c4039 100644
--- a/src/codec/SkIcoCodec.cpp
+++ b/src/codec/SkIcoCodec.cpp
@@ -157,12 +157,11 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
}
// Use the largest codec as a "suggestion" for image info
- size_t maxSize = 0;
- int maxIndex = 0;
- for (int i = 0; i < codecs->count(); i++) {
+ uint32_t maxSize = 0;
+ uint32_t maxIndex = 0;
+ for (int32_t i = 0; i < codecs->count(); i++) {
SkImageInfo info = codecs->operator[](i)->getInfo();
- size_t size = info.getSafeSize(info.minRowBytes());
-
+ uint32_t size = info.width() * info.height();
if (size > maxSize) {
maxSize = size;
maxIndex = i;