summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp6
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp4
2 files changed, 9 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp b/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp
index f2d1400..d6fa5ce 100644
--- a/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp
@@ -58,6 +58,12 @@ class GraphicsContextPlatformPrivate {
public:
GraphicsContextPlatformPrivate(PlatformGraphicsContext* platformContext)
: m_context(platformContext) { }
+ ~GraphicsContextPlatformPrivate()
+ {
+ if (m_context && m_context->deleteUs())
+ delete m_context;
+ }
+
PlatformGraphicsContext* context() { return m_context; }
diff --git a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp
index c9c887a..aa84427 100644
--- a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp
@@ -131,7 +131,9 @@ unsigned ImageTexture::computeCRC(const SkBitmap* bitmap)
return 0;
bitmap->lockPixels();
uint8_t* img = static_cast<uint8_t*>(bitmap->getPixels());
- unsigned crc = computeCrc(img, bitmap->getSize());
+ unsigned crc = 0;
+ if (img)
+ crc = computeCrc(img, bitmap->getSize());
bitmap->unlockPixels();
return crc;
}