Chromium Code Reviews| 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 |