From b9c7e5b5fff88c86ed19c9753b3b8a2499293bee Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 12 Sep 2022 15:58:13 +0200 Subject: vo_gpu_next: only require full pixel byte alignment The current code also rejects e.g. rgb30, even though this format is perfectly valid, because it only checks for alignment of the used bits. --- video/out/vo_gpu_next.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video/out') diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 776fdf49cd..d5b85411c0 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -348,6 +348,9 @@ static int plane_data_from_imgfmt(struct pl_plane_data out_data[4], struct pl_plane_data *data = &out_data[p]; struct mp_imgfmt_comp_desc sorted[MP_NUM_COMPONENTS]; int num_comps = 0; + if (desc.bpp[p] % 8) + return 0; // Pixel size is not byte-aligned + for (int c = 0; c < mp_imgfmt_desc_get_num_comps(&desc); c++) { if (desc.comps[c].plane != p) continue; @@ -398,9 +401,6 @@ 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 = desc.bpp[p] / 8; data->type = (desc.flags & MP_IMGFLAG_TYPE_FLOAT) ? PL_FMT_FLOAT -- cgit v1.2.3