mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
basetextoverlay: FIX crash if padding greater than video size
Skipping rendering of textimage if overlay is completely outside video frame. https://bugzilla.gnome.org/show_bug.cgi?id=754429
This commit is contained in:
parent
9361f7c576
commit
7447736be9
1 changed files with 13 additions and 0 deletions
|
@ -1673,6 +1673,19 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,
|
|||
height = ceil (height * overlay->render_scale);
|
||||
scalef *= overlay->render_scale;
|
||||
|
||||
if (width <= 0 || height <= 0) {
|
||||
g_mutex_unlock (GST_BASE_TEXT_OVERLAY_GET_CLASS (overlay)->pango_lock);
|
||||
GST_DEBUG_OBJECT (overlay,
|
||||
"Overlay is outside video frame. Skipping text rendering");
|
||||
return;
|
||||
}
|
||||
|
||||
if (unscaled_height <= 0 || unscaled_width <= 0) {
|
||||
g_mutex_unlock (GST_BASE_TEXT_OVERLAY_GET_CLASS (overlay)->pango_lock);
|
||||
GST_DEBUG_OBJECT (overlay,
|
||||
"Overlay is outside video frame. Skipping text rendering");
|
||||
return;
|
||||
}
|
||||
/* Prepare the transformation matrix. Note that the transformation happens
|
||||
* in reverse order. So for horizontal text, we will translate and then
|
||||
* scale. This is important to understand which scale shall be used. */
|
||||
|
|
Loading…
Reference in a new issue