avfilter/vf_pixdesctest: also take into account undefined alpha components

Ensure those bits are copied, which will result in the output being the same as
the input, where swscale set them to the equivalent of fully opaque.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-10-17 22:26:10 -03:00
parent 8debc5aa41
commit dfd7acf3ed
12 changed files with 12 additions and 12 deletions

View file

@ -84,7 +84,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (priv->pix_desc->flags & AV_PIX_FMT_FLAG_PAL)
memcpy(out->data[1], in->data[1], AVPALETTE_SIZE);
for (c = 0; c < priv->pix_desc->nb_components; c++) {
for (c = 0; c < FF_ARRAY_ELEMS(priv->pix_desc->comp); c++) {
const int w1 = c == 1 || c == 2 ? cw : w;
const int h1 = c == 1 || c == 2 ? ch : h;