diff options
author | Marco Nelissen <marcone@google.com> | 2014-05-01 15:25:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-01 15:25:13 +0000 |
commit | ab3977d21161815c130bdedf21e2571382d208da (patch) | |
tree | bc4ddccb18548f5ce08eb3f3034dab7a45acdf19 /media | |
parent | 1cec7f8539e6465ff80577169d7d07df3c2574b7 (diff) | |
parent | c847a4835b2233d28f6479deeed0592d267ee7bd (diff) | |
download | frameworks_base-ab3977d21161815c130bdedf21e2571382d208da.zip frameworks_base-ab3977d21161815c130bdedf21e2571382d208da.tar.gz frameworks_base-ab3977d21161815c130bdedf21e2571382d208da.tar.bz2 |
Merge "MetadataRetriever: Check null pointer to avoid tombstone crash."
Diffstat (limited to 'media')
-rw-r--r-- | media/jni/android_media_MediaMetadataRetriever.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp index 6176f0f..c2694f1 100644 --- a/media/jni/android_media_MediaMetadataRetriever.cpp +++ b/media/jni/android_media_MediaMetadataRetriever.cpp @@ -262,6 +262,13 @@ static jobject android_media_MediaMetadataRetriever_getFrameAtTime(JNIEnv *env, width, height, config); + if (jBitmap == NULL) { + if (env->ExceptionCheck()) { + env->ExceptionClear(); + } + ALOGE("getFrameAtTime: create Bitmap failed!"); + return NULL; + } SkBitmap *bitmap = (SkBitmap *) env->GetLongField(jBitmap, fields.nativeBitmap); |