Skip to content

Commit 81b37d8

Browse files
author
Gloria Wang
committed
If media player has died already, do not dec the old surface texture reference.
Otherwise segfault will occur. For bug 5327664. Do not merge. Change-Id: I03ea7bc047aa99a106f1e010dac74f75a833ef84
1 parent c286b2c commit 81b37d8

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)