diff options
author | Bo Liu <boliu@google.com> | 2014-11-25 16:59:27 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-25 16:59:27 +0000 |
commit | 3813430367591efcf925b2baebc50a99a7666644 (patch) | |
tree | 95a0c26064767dde538959ce4808cb9de3b2b42b /core/jni/android | |
parent | f2a382d4f7de5336d0c20358bb694e205a38fc38 (diff) | |
parent | 84be180e97f920a9400789368a6bc54c5a9b90d8 (diff) | |
download | frameworks_base-3813430367591efcf925b2baebc50a99a7666644.zip frameworks_base-3813430367591efcf925b2baebc50a99a7666644.tar.gz frameworks_base-3813430367591efcf925b2baebc50a99a7666644.tar.bz2 |
am 84be180e: Merge "Fix crash in getNativeCanvas when canvasHandle is NULL" into lmp-mr1-dev
* commit '84be180e97f920a9400789368a6bc54c5a9b90d8':
Fix crash in getNativeCanvas when canvasHandle is NULL
Diffstat (limited to 'core/jni/android')
-rw-r--r-- | core/jni/android/graphics/Graphics.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp index d7b75db..2eccfbd 100644 --- a/core/jni/android/graphics/Graphics.cpp +++ b/core/jni/android/graphics/Graphics.cpp @@ -365,6 +365,9 @@ SkCanvas* GraphicsJNI::getNativeCanvas(JNIEnv* env, jobject canvas) { SkASSERT(canvas); SkASSERT(env->IsInstanceOf(canvas, gCanvas_class)); jlong canvasHandle = env->GetLongField(canvas, gCanvas_nativeInstanceID); + if (!canvasHandle) { + return NULL; + } SkCanvas* c = reinterpret_cast<android::Canvas*>(canvasHandle)->getSkCanvas(); SkASSERT(c); return c; |