[vlc-commits] lib/video: fix invalid id in input_GetEsObjects
Thomas Guillem
git at videolan.org
Tue Mar 14 11:22:37 CET 2017
vlc/vlc-2.2 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 14 10:20:36 2017 +0100| [2b761b66420e2160407264118655f5353e2e4875] | 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 bf9ef35ea16260c5b485285366a32cadbd4de970)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=2b761b66420e2160407264118655f5353e2e4875
---
lib/video.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/video.c b/lib/video.c
index 19065fb..0e3ccb5 100644
--- a/lib/video.c
+++ b/lib/video.c
@@ -466,11 +466,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