diff options
author | Bo Liu <boliu@google.com> | 2014-11-25 18:46:04 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-25 18:46:04 +0000 |
commit | 88309159a53ceb4f34fe01056521e4b84e848ef7 (patch) | |
tree | 54e2c7ea1dea6cf510996b3b493d28f3201942a9 /core/jni/android | |
parent | af3efb4a9ea9eafc86888be48c88fe638a22c7e9 (diff) | |
parent | 3813430367591efcf925b2baebc50a99a7666644 (diff) | |
download | frameworks_base-88309159a53ceb4f34fe01056521e4b84e848ef7.zip frameworks_base-88309159a53ceb4f34fe01056521e4b84e848ef7.tar.gz frameworks_base-88309159a53ceb4f34fe01056521e4b84e848ef7.tar.bz2 |
am 38134303: am 84be180e: Merge "Fix crash in getNativeCanvas when canvasHandle is NULL" into lmp-mr1-dev
* commit '3813430367591efcf925b2baebc50a99a7666644':
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; |