frontends/va: correct check for invalid format

We need to check against the correct define, DRM_FORMAT_INVALID.
Checking an uint32_t against DRM_FORMAT_MOD_INVALID will always produce
false anyway.

Caught by Coverity.

Fixes: b85c6531f6 ("frontends/va: add support for VA_EXPORT_SURFACE_COMPOSED_LAYERS")
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9897>
This commit is contained in:
Erik Faye-Lund 2021-03-29 15:09:19 +02:00 committed by Marge Bot
parent f891c78a14
commit 837f76edb8
1 changed files with 1 additions and 1 deletions

View File

@ -1117,7 +1117,7 @@ vlVaExportSurfaceHandle(VADriverContextP ctx,
if (flags & VA_EXPORT_SURFACE_COMPOSED_LAYERS) {
uint32_t drm_format = pipe_format_to_drm_format(surf->buffer->buffer_format);
if (drm_format == DRM_FORMAT_MOD_INVALID) {
if (drm_format == DRM_FORMAT_INVALID) {
ret = VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE;
goto fail;
}