gstplay: fix segmentation fault caused by subtitle info update
authorElliot Chen <elliot.chen@nxp.com>
Thu, 10 Nov 2022 07:07:20 +0000 (15:07 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 10 Nov 2022 14:07:39 +0000 (14:07 +0000)
For subtitle stream played by subrui, gstplay will update subtitle
information before select the stream by using playbin3. Need check
the subtitle_sid value to avoid segmentation fault.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3383>

subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c

index 950be08..40bd39c 100644 (file)
@@ -1756,7 +1756,7 @@ gst_play_subtitle_info_update (GstPlay * self, GstPlayStreamInfo * stream_info)
 
       g_object_get (G_OBJECT (self->playbin), "current-suburi", &suburi, NULL);
       if (suburi) {
-        if (self->use_playbin3) {
+        if (self->use_playbin3 && self->subtitle_sid) {
           if (g_str_equal (self->subtitle_sid, stream_info->stream_id))
             info->language = g_path_get_basename (suburi);
         } else {