[vlc-devel] [PATCH 01/17] android: utils: fix double free

Alexandre Janniaux ajanni at videolabs.io
Wed Jan 13 11:07:14 UTC 2021


The SurfaceTexture class is freed multiple times whenever the
libvlc_media_player is restarted.
---
 modules/video_output/android/utils.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/modules/video_output/android/utils.c b/modules/video_output/android/utils.c
index 1cd7469cf2..6e8a6f22b0 100644
--- a/modules/video_output/android/utils.c
+++ b/modules/video_output/android/utils.c
@@ -893,12 +893,6 @@ AWindowHandler_destroy(AWindowHandler *p_awh)
 
     if (p_env)
     {
-        if (jfields.SurfaceTexture.clazz)
-            (*p_env)->DeleteGlobalRef(p_env, jfields.SurfaceTexture.clazz);
-
-        if (jfields.Surface.clazz)
-            (*p_env)->DeleteGlobalRef(p_env, jfields.Surface.clazz);
-
         JNI_ANWCALL(CallVoidMethod, unregisterNative);
         AWindowHandler_releaseANativeWindowEnv(p_awh, p_env, AWindow_Video);
         AWindowHandler_releaseANativeWindowEnv(p_awh, p_env, AWindow_Subtitles);
-- 
2.30.0



More information about the vlc-devel mailing list