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

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 1315633004: Quick Fix to the toBlob mime type Layout Test that crash the memorysanitizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed crash flag Created 5 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 783294dcd628cd556332c69410b032f9a88e8380..492c0912d8324e6ebe948f49ab2677f6f9dea79e 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -555,10 +555,12 @@ void HTMLCanvasElement::toBlob(FileCallback* callback, const String& mimeType, c
}
double quality;
+ double* qualityPtr = nullptr;
if (!qualityArgument.isEmpty()) {
v8::Local<v8::Value> v8Value = qualityArgument.v8Value();
if (v8Value->IsNumber()) {
quality = v8Value.As<v8::Number>()->Value();
+ qualityPtr = &quality;
}
}
@@ -569,7 +571,7 @@ void HTMLCanvasElement::toBlob(FileCallback* callback, const String& mimeType, c
// Perform image encoding
Vector<char> encodedImage;
- ImageDataBuffer(imageData->size(), imageData->data()->data()).encodeImage(encodingMimeType, &quality, &encodedImage);
+ ImageDataBuffer(imageData->size(), imageData->data()->data()).encodeImage(encodingMimeType, qualityPtr, &encodedImage);
resultBlob = File::create(encodedImage.data(), encodedImage.size(), encodingMimeType);
Platform::current()->mainThread()->postTask(FROM_HERE, bind(&FileCallback::handleEvent, callback, resultBlob));
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698