Fix bmp RLE "bug"
authormsarett <msarett@google.com>
Wed, 12 Aug 2015 15:08:56 +0000 (08:08 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 12 Aug 2015 15:08:56 +0000 (08:08 -0700)
commitd0375bc4607f9d3f2ec427771e90ec7d284c174d
tree0fca66621db65f4f8c4d7a4ae09222ba672dda09
parente14c1fe04fc72ec9bcf55820b5c65a71d7d0a764
Fix bmp RLE "bug"

Chromium's test suite contains an RLE image that reports a certain
file size in the header, but then contains additional encoded data.
Our bmp decoder would only decode half of the image, before stopping.

With this fix, we check for additional data before returning
kIncompleteInput.

If this lands, I will upload the test image to the bots.

Also adding an invalid image test to CodexTest.

BUG=skia:

Review URL: https://codereview.chromium.org/1273853004
resources/invalid_images/mask-bmp-ico.ico [new file with mode: 0644]
src/codec/SkBmpCodec.cpp
src/codec/SkBmpRLECodec.cpp
src/codec/SkBmpRLECodec.h
tests/CodexTest.cpp