aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkBmpRLECodec.h
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-08-12 08:08:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-12 08:08:56 -0700
commitd0375bc4607f9d3f2ec427771e90ec7d284c174d (patch)
tree0fca66621db65f4f8c4d7a4ae09222ba672dda09 /src/codec/SkBmpRLECodec.h
parente14c1fe04fc72ec9bcf55820b5c65a71d7d0a764 (diff)
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
Diffstat (limited to 'src/codec/SkBmpRLECodec.h')
-rw-r--r--src/codec/SkBmpRLECodec.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/codec/SkBmpRLECodec.h b/src/codec/SkBmpRLECodec.h
index f1f1ae97d8..ee8989be64 100644
--- a/src/codec/SkBmpRLECodec.h
+++ b/src/codec/SkBmpRLECodec.h
@@ -56,6 +56,15 @@ private:
bool initializeStreamBuffer();
/*
+ * Before signalling kIncompleteInput, we should attempt to load the
+ * stream buffer with additional data.
+ *
+ * @return the number of bytes remaining in the stream buffer after
+ * attempting to read more bytes from the stream
+ */
+ size_t checkForMoreData();
+
+ /*
* Set an RLE pixel using the color table
*/
void setPixel(void* dst, size_t dstRowBytes,