libs: surface: return fail immediately if can not create subpicture

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/331>
This commit is contained in:
He Junyan 2020-05-23 20:48:54 +08:00
parent 6333c85316
commit 2515d4dd2f

View file

@ -1036,6 +1036,10 @@ gst_vaapi_surface_set_subpictures_from_composition (GstVaapiSurface * surface,
rect = gst_video_overlay_composition_get_rectangle (composition, n);
subpicture = gst_vaapi_subpicture_new_from_overlay_rectangle (display,
rect);
if (subpicture == NULL) {
GST_WARNING ("could not create subpicture for rectangle %p", rect);
return FALSE;
}
gst_video_overlay_rectangle_get_render_rectangle (rect,
(gint *) & sub_rect.x, (gint *) & sub_rect.y,