Avoid integer overflow in SkIcoCodec
authorMatt Sarett <msarett@google.com>
Mon, 17 Oct 2016 16:30:39 +0000 (12:30 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Mon, 17 Oct 2016 17:10:40 +0000 (17:10 +0000)
commit20cba06a4bc9bde60b2dc37907d11ca81ba35ce8
tree3cd1d325542f93ab0151bf6a4ecffbd5b3496668
parenta2c2fdd49b421f92cb2fe3b0b062c682f902bd0a
Avoid integer overflow in SkIcoCodec

Definitely good to avoid overflow here.

FWIW, this looks to be harmless for Android's current use.
They will just fail later on when trying to allocate the
bitmap.

BUG=skia:5857

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3527

Change-Id: Ia1fb7d864d21ecdb127a1dd1a72cab8375cb43fb
Reviewed-on: https://skia-review.googlesource.com/3527
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
resources/invalid_images/int_overflow.ico [new file with mode: 0644]
src/codec/SkIcoCodec.cpp
tests/CodecTest.cpp