summaryrefslogtreecommitdiffstats
path: root/media/jni
diff options
context:
space:
mode:
Diffstat (limited to 'media/jni')
-rw-r--r--media/jni/android_media_MediaMetadataRetriever.cpp7
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);