vo_gpu_next: use correct pixel size when mapping formats

`total_bits` may be less than the true pixel stride (`bpp`) for formats
which contain extra ignored components (e.g. rgb0).
This commit is contained in:
Niklas Haas 2022-09-12 15:25:56 +02:00
parent 38a7562ebe
commit 7a6dc79e29
1 changed files with 1 additions and 1 deletions

View File

@ -401,7 +401,7 @@ static int plane_data_from_imgfmt(struct pl_plane_data out_data[4],
if (total_bits % 8)
return 0; // pixel size is not byte-aligned
data->pixel_stride = total_bits / 8;
data->pixel_stride = desc.bpp[p] / 8;
data->type = (desc.flags & MP_IMGFLAG_TYPE_FLOAT)
? PL_FMT_FLOAT
: PL_FMT_UNORM;