[vlc-commits] lib/video: fix invalid id in input_GetEsObjects

Thomas Guillem git at videolan.org
Tue Mar 14 10:51:47 CET 2017


vlc/vlc-2.2 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 14 10:20:36 2017 +0100| [1e6484392deb153e83dff8d7deda8e679e688bdc] | committer: Jean-Baptiste Kempf

lib/video: fix invalid id in input_GetEsObjects

This fixes a SEGFAULT when calling libvlc_video_set_teletext when there is no
teletext-es.

Fixes #11854

(cherry picked from commit 352dcbde63fde8cb6b3a8c0618358b61f126b06f)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=1e6484392deb153e83dff8d7deda8e679e688bdc
---

 lib/video.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/video.c b/lib/video.c
index 19065fb..0e4315c 100644
--- a/lib/video.c
+++ b/lib/video.c
@@ -466,11 +466,15 @@ void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page )
     }
 
     telx = var_GetInteger( p_input_thread, "teletext-es" );
-    if( input_GetEsObjects( p_input_thread, telx, &p_zvbi, NULL, NULL )
-        == VLC_SUCCESS )
+    if( telx >= 0 )
     {
-        var_SetInteger( p_zvbi, "vbi-page", i_page );
-        vlc_object_release( p_zvbi );
+        if( input_GetEsObjects( p_input_thread, telx, &p_zvbi, NULL, NULL )
+            == VLC_SUCCESS )
+        {
+            var_SetInteger( p_zvbi, "vbi-page", i_page );
+            vlc_object_release( p_zvbi );
+        }
+    }
     }
     vlc_object_release( p_input_thread );
 }



More information about the vlc-commits mailing list