Skip to content

Commit

Permalink
Add check for Chromium passing 0 surfaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
elFarto committed Nov 6, 2023
1 parent 9888709 commit ea6d862
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vabackend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,11 @@ static VAStatus nvCreateContext(
cfg->bitDepth = surface->bitDepth;
}

if (drv->surfaceCount == 0 && num_render_targets == 0) {
LOG("0 surfaces have been passed to vaCreateContext, this might cause errors. Setting surface count to 16");
num_render_targets = 16;
}

CUVIDDECODECREATEINFO vdci = {
.ulWidth = vdci.ulMaxWidth = vdci.ulTargetWidth = picture_width,
.ulHeight = vdci.ulMaxHeight = vdci.ulTargetHeight = picture_height,
Expand Down

0 comments on commit ea6d862

Please sign in to comment.