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

Unified Diff: Source/core/platform/graphics/Pattern.cpp

Issue 57643005: [2D Canvas] Fix crash in createPattern method when using invalid canvas as source. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | « LayoutTests/fast/canvas/canvas-large-pattern-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/Pattern.cpp
diff --git a/Source/core/platform/graphics/Pattern.cpp b/Source/core/platform/graphics/Pattern.cpp
index 61ae7ce3027ac6b9b68d418a047d36f3344d5fa5..3de80d91339eda5bb46258aa76715b525c9c4c2f 100644
--- a/Source/core/platform/graphics/Pattern.cpp
+++ b/Source/core/platform/graphics/Pattern.cpp
@@ -42,8 +42,9 @@ Pattern::Pattern(PassRefPtr<Image> image, bool repeatX, bool repeatY)
, m_repeatY(repeatY)
, m_externalMemoryAllocated(0)
{
- ASSERT(image);
- m_tileImage = image->nativeImageForCurrentFrame();
+ if (image) {
+ m_tileImage = image->nativeImageForCurrentFrame();
+ }
}
Pattern::~Pattern()
« no previous file with comments | « LayoutTests/fast/canvas/canvas-large-pattern-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698