mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
basetextoverlay: Correctly handle empty text buffers
This commit is contained in:
parent
dc2f2c9a40
commit
c4fb8d1e69
1 changed files with 33 additions and 28 deletions
|
@ -2210,6 +2210,7 @@ wait_for_text_buf:
|
||||||
in_text = (gchar *) map.data;
|
in_text = (gchar *) map.data;
|
||||||
in_size = map.size;
|
in_size = map.size;
|
||||||
|
|
||||||
|
if (in_size > 0) {
|
||||||
/* g_markup_escape_text() absolutely requires valid UTF8 input, it
|
/* g_markup_escape_text() absolutely requires valid UTF8 input, it
|
||||||
* might crash otherwise. We don't fall back on GST_SUBTITLE_ENCODING
|
* might crash otherwise. We don't fall back on GST_SUBTITLE_ENCODING
|
||||||
* here on purpose, this is something that needs fixing upstream */
|
* here on purpose, this is something that needs fixing upstream */
|
||||||
|
@ -2244,6 +2245,10 @@ wait_for_text_buf:
|
||||||
}
|
}
|
||||||
if (in_text != (gchar *) map.data)
|
if (in_text != (gchar *) map.data)
|
||||||
g_free (in_text);
|
g_free (in_text);
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (overlay, "No text to render (empty buffer)");
|
||||||
|
gst_base_text_overlay_render_text (overlay, " ", 1);
|
||||||
|
}
|
||||||
|
|
||||||
gst_buffer_unmap (overlay->text_buffer, &map);
|
gst_buffer_unmap (overlay->text_buffer, &map);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue