File CVE-2025-47808.patch of Package gstreamer-plugins-base.39271

From 6b19f117518a765a25c99d1c4b09f2838a8ed0c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Thu, 8 May 2025 09:04:52 +0300
Subject: [PATCH] tmplayer: Don't append NULL + 1 to the string buffer when
 parsing lines without text

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4417
Fixes CVE-2025-47808

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9132>
---
diff -urp gst-plugins-base-1.24.0.orig/gst/subparse/tmplayerparse.c gst-plugins-base-1.24.0/gst/subparse/tmplayerparse.c
--- gst-plugins-base-1.24.0.orig/gst/subparse/tmplayerparse.c	2024-03-04 17:51:42.000000000 -0600
+++ gst-plugins-base-1.24.0/gst/subparse/tmplayerparse.c	2025-06-10 16:00:35.053155882 -0500
@@ -125,7 +125,9 @@ tmplayer_parse_line (ParserState * state
        * durations from the start times anyway, so as long as the parser just
        * forwards state->start_time by duration after it pushes the line we
        * are about to return it will all be good. */
-      g_string_append (state->buf, text_start + 1);
+      if (text_start) {
+        g_string_append (state->buf, text_start + 1);
+      }
     } else if (line_num > 0) {
       GST_WARNING ("end of subtitle unit but no valid start time?!");
     }
openSUSE Build Service is sponsored by