diff --git a/src/gallium/frontends/va/config.c b/src/gallium/frontends/va/config.c index e658867f6e0..2b37d8cb8d3 100644 --- a/src/gallium/frontends/va/config.c +++ b/src/gallium/frontends/va/config.c @@ -214,8 +214,10 @@ vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoin return VA_STATUS_ERROR_ALLOCATION_FAILED; if (profile == VAProfileNone) { - if (entrypoint != VAEntrypointVideoProc) + if (entrypoint != VAEntrypointVideoProc) { + FREE(config); return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT; + } config->entrypoint = PIPE_VIDEO_ENTRYPOINT_UNKNOWN; config->profile = PIPE_VIDEO_PROFILE_UNKNOWN; diff --git a/src/gallium/frontends/va/context.c b/src/gallium/frontends/va/context.c index 556e0cb74e7..53077ee45c7 100644 --- a/src/gallium/frontends/va/context.c +++ b/src/gallium/frontends/va/context.c @@ -251,8 +251,10 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width, config->profile, config->entrypoint, PIPE_VIDEO_CAP_MAX_HEIGHT); - if (picture_width > max_supported_width || picture_height > max_supported_height) + if (picture_width > max_supported_width || picture_height > max_supported_height) { + FREE(context); return VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED; + } } context->templat.profile = config->profile; context->templat.entrypoint = config->entrypoint;