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

Thomas Guillem git at videolan.org
Tue Mar 14 10:57:02 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 14 10:20:36 2017 +0100| [bf9ef35ea16260c5b485285366a32cadbd4de970] | 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

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

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

diff --git a/lib/video.c b/lib/video.c
index 46f9935..69c5fb8 100644
--- a/lib/video.c
+++ b/lib/video.c
@@ -507,11 +507,14 @@ 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