Add a check to see if decoder is valid before using it. Currently we
only support decode and encode operations, return unsupported error
for all other entrypoints.
Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21905>
return VA_STATUS_ERROR_INVALID_CONTEXT;
}
+ if (!context->decoder) {
+ mtx_unlock(&drv->mutex);
+ return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ }
+
if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) {
int ret = 0;
return VA_STATUS_ERROR_INVALID_CONTEXT;
}
+ if (!context->decoder) {
+ mtx_unlock(&drv->mutex);
+ return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ }
+
if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
if(surf->feedback == NULL)
*status=VASurfaceReady;