Skip to content

Commit 9184947

Browse files
Gloria WangAndroid (Google) Code Review
authored andcommitted
Merge "If media player has died already, do not dec the old surface texture reference. Otherwise segfault will occur. For bug 5327664. Do not merge." into ics-factoryrom
2 parents 62c24d7 + 81b37d8 commit 9184947

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

media/jni/android_media_MediaPlayer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ getVideoSurfaceTexture(JNIEnv* env, jobject thiz) {
247247
static void
248248
decVideoSurfaceRef(JNIEnv *env, jobject thiz)
249249
{
250+
sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
251+
if (mp == NULL) {
252+
return;
253+
}
254+
250255
sp<ISurfaceTexture> old_st = getVideoSurfaceTexture(env, thiz);
251256
if (old_st != NULL) {
252257
old_st->decStrong(thiz);

0 commit comments

Comments
 (0)