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

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

Issue 2391073003: ICO: Skip checking declared entry bounds when file is completelly received. (Closed)
Patch Set: Created 4 years, 2 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 96011a494b66d24a3969a23cce41b6059af0f494..0259da01d707653a8beebee1b8a3a2abcaccd939 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -131,6 +131,11 @@ size_t ICOImageDecoder::decodeFrameCount() {
if (failed())
return m_frameBufferCache.size();
+ // Skip checking entries offset and byte size when file is fully received.
+ // See crbug.com/653075.
Peter Kasting 2016/10/05 19:03:27 Nit: I'd like this comment to say more about why w
+ if (isAllDataReceived())
+ return m_dirEntries.size();
+
// Length of sequence of completely received frames.
for (size_t i = 0; i < m_dirEntries.size(); ++i) {
const IconDirectoryEntry& dirEntry = m_dirEntries[i];

Powered by Google App Engine
This is Rietveld 408576698