mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
libs: surface: ensure composite overlay is not bigger
Ensure the composition overlay rectangle (subtitles) is not bigger than the surface where it is going to be composited and rendered. https://bugzilla.gnome.org/show_bug.cgi?id=766978
This commit is contained in:
parent
c67edea4ab
commit
574ff693a5
1 changed files with 4 additions and 0 deletions
|
@ -1016,6 +1016,10 @@ gst_vaapi_surface_set_subpictures_from_composition (GstVaapiSurface * surface,
|
|||
(gint *) & sub_rect.x, (gint *) & sub_rect.y,
|
||||
&sub_rect.width, &sub_rect.height);
|
||||
|
||||
/* ensure that the overlay is not bigger than the surface */
|
||||
sub_rect.y = MIN (sub_rect.y, surface->height);
|
||||
sub_rect.width = MIN (sub_rect.width, surface->width);
|
||||
|
||||
if (!gst_vaapi_surface_associate_subpicture (surface, subpicture,
|
||||
NULL, &sub_rect)) {
|
||||
GST_WARNING ("could not render overlay rectangle %p", rect);
|
||||
|
|
Loading…
Reference in a new issue