Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1302)

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp

Issue 2081013002: Re-enable DrMemory test for ICOImageDecoderTests.parseAndDecodeByteByByte. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
index f8d39b99ad264cef00633c49a40f6643b3af1b64..257caac7beb16399c5efd873ba3ccf27283b2572 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -162,9 +162,9 @@ void ICOImageDecoder::decode(size_t index, bool onlySize)
// may have called SharedBuffer::mergeSegmentsIntoBuffer().
m_fastReader.clearCache();
- // If we couldn't decode the image but we've received all the data, decoding
- // has failed.
- if ((!decodeDirectory() || (!onlySize && !decodeAtIndex(index))) && isAllDataReceived()) {
+ // If we couldn't decode the image or the data was truncated but we've
+ // received all the data, decoding has failed.
+ if ((!decodeDirectory() || m_data->size() < m_decodedOffset || (!onlySize && !decodeAtIndex(index))) && isAllDataReceived()) {
Peter Kasting 2016/06/20 23:08:03 Why do we want this behavior? If we're not trying
aleksandar.stojiljkovic 2016/06/20 23:30:24 I have put explanation above, in decodeFrameCount
setFailed();
// If we're done decoding this frame, we don't need the BMPImageReader or
// PNGImageDecoder anymore. (If we failed, these have already been

Powered by Google App Engine
This is Rietveld 408576698