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

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

Issue 2517693002: Add null check in createTransparentImage (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index 655442579b0afbc4d611446376ec62f42f9455c4..7a085d9c01ca834cd0978d65a6417832f05f26a7 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -115,7 +115,8 @@ PassRefPtr<Image> createTransparentImage(const IntSize& size) {
DCHECK(ImageBuffer::canCreateImageBuffer(size));
sk_sp<SkSurface> surface =
SkSurface::MakeRasterN32Premul(size.width(), size.height());
- return StaticBitmapImage::create(surface->makeImageSnapshot());
+ return surface ? StaticBitmapImage::create(surface->makeImageSnapshot())
+ : nullptr;
}
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698