Skip to content

Commit

Permalink
va: set driver number to be zero if vaGetDriverNames failed
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Zhang <[email protected]>
  • Loading branch information
XinfengZhang committed Jul 18, 2023
1 parent 984dfee commit fe87f9c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions va/va.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ static VAStatus va_new_opendriver(VADisplay dpy)
if (vaStatus != VA_STATUS_SUCCESS) {
/* Print and error yet continue, as per the above ordering note */
va_errorMessage(dpy, "vaGetDriverNames() failed with %s\n", vaErrorStr(vaStatus));
num_drivers = 0;
} else if (num_drivers > ARRAY_SIZE(drivers)) {
va_errorMessage(dpy, "DRIVER BUG: vaGetDriverNames() provides too many drivers\n");
num_drivers = ARRAY_SIZE(drivers);
Expand Down

0 comments on commit fe87f9c

Please sign in to comment.