mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
msdkvpp: check mfx surface nullity for the input buffer
In theory it should not happen but it happened to me in some cases where it failed to allocate some video buffers so this was a consequence of a corner case. Better to be safe than sorry.
This commit is contained in:
parent
8154b22a88
commit
b681d6f62e
1 changed files with 7 additions and 1 deletions
|
@ -729,11 +729,17 @@ gst_msdkvpp_transform (GstBaseTransform * trans, GstBuffer * inbuf,
|
|||
if (!in_surface)
|
||||
return GST_FLOW_ERROR;
|
||||
|
||||
if (!in_surface->surface) {
|
||||
GST_ERROR_OBJECT (thiz, "mfx surface is NULL for the current input buffer");
|
||||
free_msdk_surface (in_surface);
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
if (gst_msdk_is_msdk_buffer (outbuf)) {
|
||||
out_surface = g_slice_new0 (MsdkSurface);
|
||||
out_surface->surface = gst_msdk_get_surface_from_buffer (outbuf);
|
||||
} else {
|
||||
GST_ERROR ("Failed to get msdk outsurface!");
|
||||
GST_ERROR_OBJECT (thiz, "Failed to get msdk outsurface!");
|
||||
free_msdk_surface (in_surface);
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue