skia2/resources/invalid_images
Leon Scroggins III b3b24538e0 Use fixed size buffer for RLE bmps
An RLE bmp reports how many bytes it should contain. This number may be
incorrect, or it may be a very large number. Previously, we buffered
all bytes in a single allocation. Instead, use a fixed size buffer and
only read what fits into the buffer. We already have code to refill the
buffer if there is more data, so rely on that to keep reading.

Choose an arbitrary size for the buffer. It is larger than the maximum
possible number of bytes we need to read at once.

Add a test with a test image that reports a very large number for
the number of bytes it should contain. With the old method, we would
allocate 4 gigs of memory to decode this image, which is unnecessary
and may result in OOM.

BUG=b/33251605

Change-Id: I6d66eace626002725f62237617140cab99ce42f3
Reviewed-on: https://skia-review.googlesource.com/7028
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-01-19 14:21:02 +00:00
..
b33251605.bmp Use fixed size buffer for RLE bmps 2017-01-19 14:21:02 +00:00
b33651913.bmp Stop supporting kUnknown_BmpHeaderType 2016-12-15 21:48:03 +00:00
ico_fuzz0.ico Ico security issues fix 2015-03-13 08:07:01 -07:00
ico_fuzz1.ico Ico security issues fix 2015-03-13 08:07:01 -07:00
ico_leak01.ico Ico security issues fix 2015-03-13 08:07:01 -07:00
int_overflow.ico Avoid integer overflow in SkIcoCodec and SkImageInfo 2016-10-17 21:19:54 +00:00
many-progressive-scans.jpg Fail jpeg decodes on too many progressive scans 2016-11-08 21:39:15 +00:00
mask-bmp-ico.ico Fix bmp RLE "bug" 2015-08-12 08:08:56 -07:00
sigabort_favicon.ico Add tests (and fix!) for known bad ICO files. 2014-11-10 13:12:25 -08:00
sigsegv_favicon_2.ico Add tests (and fix!) for known bad ICO files. 2014-11-10 13:12:25 -08:00
sigsegv_favicon.ico Add tests (and fix!) for known bad ICO files. 2014-11-10 13:12:25 -08:00
skbug3429.webp Use the upstream version of libwebp, v0.4.3. 2015-07-10 09:32:09 -07:00
skbug3442.webp Use the upstream version of libwebp, v0.4.3. 2015-07-10 09:32:09 -07:00
skbug5887.gif SkGifCodec: do not write off the end of memory when repeatCount > 1 2016-10-26 00:43:27 +00:00
skbug6046.gif SkGifCodec: intersect frameRect with image size 2016-12-13 14:00:17 +00:00