From 915523e136a65707f0092739471bd384bfeeb999 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 27 Mar 2026 19:14:56 +0100 Subject: [PATCH] swscale/ops: add missing check on SwsDitherOp.y_offset Doesn't actually affect anything in the currently generated ops lists. Signed-off-by: Niklas Haas --- libswscale/ops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libswscale/ops.c b/libswscale/ops.c index d86d8b0239..c281305766 100644 --- a/libswscale/ops.c +++ b/libswscale/ops.c @@ -363,8 +363,11 @@ void ff_sws_op_list_update_comps(SwsOpList *ops) break; case SWS_OP_DITHER: /* Strip zero flag because of the nonzero dithering offset */ - for (int i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { + if (op->dither.y_offset[i] < 0) + continue; op->comps.flags[i] = prev.flags[i] & ~SWS_COMP_ZERO; + } break; case SWS_OP_UNPACK: for (int i = 0; i < 4; i++) {