Skip to content
Snippets Groups Projects
Commit f27daff0 authored by Simon McVittie's avatar Simon McVittie
Browse files

check-va-api: Guard against VA_STATUS_ERROR_MAX_NUM_EXCEEDED


The documentation implies that vaQuerySurfaceAttributes could
legitimately return VA_STATUS_ERROR_MAX_NUM_EXCEEDED when we query
the number of attributes available, although it seems that in practice
it returns VA_STATUS_SUCCESS. Accept either one.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent fb871d86
No related branches found
No related tags found
1 merge request!801check-va-api: Use supported surface format + opportunistic cleanup
......@@ -212,10 +212,17 @@ create_surfaces (VADisplay va_display,
int num_formats;
autofree VAImageFormat *format_list = NULL;
bool ret = false;
VAStatus status;
#define do_vaapi_or_exit(expr) if (! _do_vaapi (#expr, expr)) goto out;
do_vaapi_or_exit (vaQuerySurfaceAttributes (va_display, config, NULL, &num_attribs));
status = vaQuerySurfaceAttributes (va_display, config, NULL, &num_attribs);
if (status != VA_STATUS_SUCCESS && status != VA_STATUS_ERROR_MAX_NUM_EXCEEDED)
{
_do_vaapi ("vaQuerySurfaceAttributes", status);
goto out;
}
attrib_list = xcalloc (num_attribs, sizeof (*attrib_list));
do_vaapi_or_exit (vaQuerySurfaceAttributes (va_display, config, attrib_list, &num_attribs));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment