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

Unified Diff: third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.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/DecodingImageGenerator.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
index bfe12625d9b40fd24892e7c195c3c23689a6a498..9bff3199a6bb5958545553d058e49316cc0b15ec 100644
--- a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
@@ -122,7 +122,7 @@ SkImageGenerator* DecodingImageGenerator::create(SkData* data)
{
// We just need the size of the image, so we have to temporarily create an ImageDecoder. Since
// we only need the size, it doesn't really matter about premul or not, or gamma settings.
- std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(static_cast<const char*>(data->data()), data->size(),
+ std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(ImageDecoder::determineImageType(static_cast<const char*>(data->data()), data->size()),
ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied);
if (!decoder)
return 0;

Powered by Google App Engine
This is Rietveld 408576698