summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-03-22 10:24:36 -0700
committerJohn Reck <jreck@google.com>2012-03-22 10:24:36 -0700
commit1081b4dc6970126a5843ed71cd9dec5125369497 (patch)
tree6bd402c7fe7ae2ed5583835f20d67346dc5c97f7
parent6aea92fd5ffd5a43b1c13769be9a16202f498b59 (diff)
downloadexternal_webkit-1081b4dc6970126a5843ed71cd9dec5125369497.zip
external_webkit-1081b4dc6970126a5843ed71cd9dec5125369497.tar.gz
external_webkit-1081b4dc6970126a5843ed71cd9dec5125369497.tar.bz2
Add missing null check
Bug: 6207830 HTMLCanvasElement will not create an imageBuffer if the size is empty or if the size is too large. Before attempting to use the copiedImage, make sure we have a buffer. Change-Id: I962c6f8d05e366631ceec911792ffb33f8cd7ca4
-rw-r--r--Source/WebCore/platform/graphics/android/CanvasLayer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/CanvasLayer.cpp b/Source/WebCore/platform/graphics/android/CanvasLayer.cpp
index 98cd5ee..75d3b8e 100644
--- a/Source/WebCore/platform/graphics/android/CanvasLayer.cpp
+++ b/Source/WebCore/platform/graphics/android/CanvasLayer.cpp
@@ -130,7 +130,7 @@ void CanvasLayer::clearDirtyRegion()
SkBitmapRef* CanvasLayer::bitmap() const
{
- if (!m_canvas)
+ if (!m_canvas || !m_canvas->buffer())
return 0;
return m_canvas->copiedImage()->nativeImageForCurrentFrame();
}