mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
basetextoverlay: segfault when xpos >= video size
When the xpos is given as greater than or equal to the video size, we get a segfault, due to improper condition. Hence adding proper conditions. https://bugzilla.gnome.org/show_bug.cgi?id=738984
This commit is contained in:
parent
cd1f1c4973
commit
900d0267d5
1 changed files with 5 additions and 3 deletions
|
@ -1349,7 +1349,7 @@ gst_base_text_overlay_get_pos (GstBaseTextOverlay * overlay,
|
|||
gint width, height;
|
||||
GstBaseTextOverlayVAlign valign;
|
||||
GstBaseTextOverlayHAlign halign;
|
||||
|
||||
*ypos = 0;
|
||||
width = overlay->image_width;
|
||||
height = overlay->image_height;
|
||||
|
||||
|
@ -1378,8 +1378,9 @@ gst_base_text_overlay_get_pos (GstBaseTextOverlay * overlay,
|
|||
*xpos = 0;
|
||||
}
|
||||
*xpos += overlay->deltax;
|
||||
if (*xpos > overlay->width) {
|
||||
if (*xpos > overlay->width || *xpos < 0) {
|
||||
/* Clip text if out of frame */
|
||||
*xpos = 0;
|
||||
overlay->silent = TRUE;
|
||||
} else {
|
||||
if (overlay->use_vertical_render)
|
||||
|
@ -1409,8 +1410,9 @@ gst_base_text_overlay_get_pos (GstBaseTextOverlay * overlay,
|
|||
break;
|
||||
}
|
||||
*ypos += overlay->deltay;
|
||||
if (*ypos > overlay->height) {
|
||||
if (*ypos > overlay->height || *ypos < 0) {
|
||||
/* Clip text if out of frame */
|
||||
*ypos = 0;
|
||||
overlay->silent = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue