summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2020-05-23 20:48:54 +0800
committerHe Junyan <junyan.he@hotmail.com>2020-05-27 15:08:11 +0800
commit2515d4dd2fd2cad1d03c56fc1f7cf854a96657b5 (patch)
tree84139fb3533f01da84db06b45a58cabd24c805af
parent6333c8531663634f72622176f3fb88e6e69a3e62 (diff)
libs: surface: return fail immediately if can not create subpicture
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/331>
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurface.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c
index 458e4e79..0fdafd99 100644
--- a/gst-libs/gst/vaapi/gstvaapisurface.c
+++ b/gst-libs/gst/vaapi/gstvaapisurface.c
@@ -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,