[vlc-commits] mediacodec: fix crash when reporting a hw error

Thomas Guillem git at videolan.org
Tue Mar 8 15:07:51 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar  8 15:06:18 2016 +0100| [155fbc6bbcf79f19abb48c9351be5647173b4c13] | committer: Thomas Guillem

mediacodec: fix crash when reporting a hw error

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=155fbc6bbcf79f19abb48c9351be5647173b4c13
---

 modules/video_output/android/utils.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/android/utils.c b/modules/video_output/android/utils.c
index 1a619ed..dec8f22 100644
--- a/modules/video_output/android/utils.c
+++ b/modules/video_output/android/utils.c
@@ -761,7 +761,9 @@ AWindowHandler_sendHardwareAccelerationError(vlc_object_t *p_obj,
     if (p_awh)
     {
         p_env = AWindowHandler_getEnv(p_awh);
-        p_awh = NULL;
+        if (!p_env)
+            return VLC_EGENERIC;
+        JNI_CALL(CallVoidMethod, sendHardwareAccelerationError);
     }
     else
     {
@@ -769,12 +771,11 @@ AWindowHandler_sendHardwareAccelerationError(vlc_object_t *p_obj,
         if (!p_awh)
             return VLC_EGENERIC;
         p_env = AWindowHandler_getEnv(p_awh);
+        if (!p_env)
+            return VLC_EGENERIC;
+        JNI_CALL(CallVoidMethod, sendHardwareAccelerationError);
+        AWindowHandler_destroy(p_awh);
     }
-    if (!p_env)
-        return VLC_EGENERIC;
 
-    JNI_CALL(CallVoidMethod, sendHardwareAccelerationError);
-    if (p_awh)
-        AWindowHandler_destroy(p_awh);
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list