mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
basetextoverlay: Fix segfault when overlay outside the frame
When the textoverlay is set outside the video frame by deltax or deltay the calculation segfaults, but it is also unnecessary since it doesn't need to be displayed. So we should clip the text. https://bugzilla.gnome.org/show_bug.cgi?id=738242
This commit is contained in:
parent
57ac7b1800
commit
1cc311156c
1 changed files with 34 additions and 26 deletions
|
@ -1364,7 +1364,10 @@ gst_base_text_overlay_get_pos (GstBaseTextOverlay * overlay,
|
|||
*xpos = 0;
|
||||
}
|
||||
*xpos += overlay->deltax;
|
||||
|
||||
if (*xpos > overlay->width) {
|
||||
/* Clip text if out of frame */
|
||||
overlay->silent = TRUE;
|
||||
} else {
|
||||
if (overlay->use_vertical_render)
|
||||
valign = GST_BASE_TEXT_OVERLAY_VALIGN_TOP;
|
||||
else
|
||||
|
@ -1392,6 +1395,11 @@ gst_base_text_overlay_get_pos (GstBaseTextOverlay * overlay,
|
|||
break;
|
||||
}
|
||||
*ypos += overlay->deltay;
|
||||
if (*ypos > overlay->height) {
|
||||
/* Clip text if out of frame */
|
||||
overlay->silent = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
Loading…
Reference in a new issue