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

Unified Diff: third_party/WebKit/Source/platform/graphics/PictureSnapshot.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/PictureSnapshot.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
index 8cc9f53a6929b0de30319d55d54a03e4150d3c39..cdf740b2784d59b9517c74e35652de7ef4f8c156 100644
--- a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
+++ b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
@@ -60,7 +60,7 @@ PictureSnapshot::PictureSnapshot(PassRefPtr<const SkPicture> picture)
static bool decodeBitmap(const void* data, size_t length, SkBitmap* result)
{
- std::unique_ptr<ImageDecoder> imageDecoder = ImageDecoder::create(static_cast<const char*>(data), length,
+ std::unique_ptr<ImageDecoder> imageDecoder = ImageDecoder::create(ImageDecoder::determineImageType(static_cast<const char*>(data), length),
ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileIgnored);
if (!imageDecoder)
return false;

Powered by Google App Engine
This is Rietveld 408576698