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

Unified Diff: third_party/WebKit/Source/core/html/ImageDocument.cpp

Issue 2261403004: ImageDocumentParser should stop sending data to ImageResource once decoding fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/ImageDocument.cpp
diff --git a/third_party/WebKit/Source/core/html/ImageDocument.cpp b/third_party/WebKit/Source/core/html/ImageDocument.cpp
index d3fb21bb4965fa5cbc3f17601c632912be9995ae..5c50aa5383bd903121dc2e122f80a85bd5a56c45 100644
--- a/third_party/WebKit/Source/core/html/ImageDocument.cpp
+++ b/third_party/WebKit/Source/core/html/ImageDocument.cpp
@@ -144,7 +144,9 @@ void ImageDocumentParser::appendBytes(const char* data, size_t length)
if (document()->cachedImage()) {
RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max());
- document()->cachedImage()->appendData(data, length);
+ // If decoding has already failed, there's no point in sending additional data to the ImageResource.
+ if (document()->cachedImage()->getStatus() != Resource::DecodeError)
+ document()->cachedImage()->appendData(data, length);
}
if (!isDetached())
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698