Avoid integer overflow in SkIcoCodec and SkImageInfo

Original Commit Message:
"""
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
"""

With the new test, ASAN also caught an integer overflow
bug in SkImageInfo.  Fix this as well.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN;master.client.skia.android:Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Debug-GN_Android

BUG=skia:5857

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

Change-Id: I0d777a547850474ea6cea87e36efa05434e33635
Reviewed-on: https://skia-review.googlesource.com/3568
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp
index 4d18c61..a6058a9 100644
--- a/tests/CodecTest.cpp
+++ b/tests/CodecTest.cpp
@@ -1362,3 +1362,10 @@
     REPORTER_ASSERT(r, result == SkCodec::kIncompleteInput);
     REPORTER_ASSERT(r, rowsDecoded == 0);
 }
+
+DEF_TEST(Codec_IcoIntOverflow, r) {
+    // ASAN will complain if there is an issue.
+    SkBitmap bitmap;
+    const bool success = GetResourceAsBitmap("invalid_images/int_overflow.ico", &bitmap);
+    REPORTER_ASSERT(r, !success);
+}