File CVE-2025-47807.patch of Package gstreamer-plugins-base.39270
From 9e2238adc1cad1fba5aad23bc8c2a6c2a65794d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Thu, 8 May 2025 09:14:15 +0300
Subject: [PATCH] subparse: Check for valid UTF-8 before cleaning up lines and
check for regex replace errors
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4418
Fixes CVE-2025-47807
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9132>
---
diff -urp gst-plugins-base-1.8.3.orig/gst/subparse/gstsubparse.c gst-plugins-base-1.8.3/gst/subparse/gstsubparse.c
--- gst-plugins-base-1.8.3.orig/gst/subparse/gstsubparse.c 2025-06-11 14:42:46.962178057 -0500
+++ gst-plugins-base-1.8.3/gst/subparse/gstsubparse.c 2025-06-11 16:08:08.210685571 -0500
@@ -914,6 +914,10 @@ parse_subrip (ParserState * state, const
g_string_append_c (state->buf, '\n');
g_string_append (state->buf, line);
if (strlen (line) == 0) {
+ if (!g_utf8_validate (state->buf->str, state->buf->len, NULL)) {
+ g_string_truncate (state->buf, 0);
+ return NULL;
+ }
ret = g_markup_escape_text (state->buf->str, state->buf->len);
g_string_truncate (state->buf, 0);
state->state = 0;