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

Unified Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.cpp

Issue 2108033003: Cancel image loads if decoding failed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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/graphics/BitmapImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
index c361c5b307450c79d0bae24ff1cb89d6563ec282..bbd35a5c1b363c05e779d3276030a83114dfa944 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -198,7 +198,11 @@ bool BitmapImage::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
if (!length)
return true;
- m_source.setData(*data, allDataReceived);
+ // If setData() returns false, we know that this is a decode error.
+ // Report size available so that it gets registered as such in
+ // ImageResource.
+ if (!m_source.setData(*data, allDataReceived))
+ return true;
return dataChanged(allDataReceived);
}

Powered by Google App Engine
This is Rietveld 408576698