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

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

Issue 2173873003: Cancel image loads if decoding failed (attempt #2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UAF 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/Image.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Image.cpp b/third_party/WebKit/Source/platform/graphics/Image.cpp
index 52afd6afbe0f53c75e29d33453be79569e3b0a98..0a7109d0cd96d25cc76889554d5567d9b4c1bcbd 100644
--- a/third_party/WebKit/Source/platform/graphics/Image.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Image.cpp
@@ -82,15 +82,15 @@ bool Image::supportsType(const String& type)
return MIMETypeRegistry::isSupportedImageResourceMIMEType(type);
}
-bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
+Image::SizeAvailability Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
{
m_encodedImageData = data;
if (!m_encodedImageData.get())
- return true;
+ return SizeAvailable;
int length = m_encodedImageData->size();
if (!length)
- return true;
+ return SizeAvailable;
return dataChanged(allDataReceived);
}

Powered by Google App Engine
This is Rietveld 408576698