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:
Julien Isorce 2019-12-05 21:19:13 -08:00 committed by GStreamer Merge Bot
parent 8154b22a88
commit b681d6f62e

View file

@ -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;
}