From cd1126a3cda6ddd20534fd74edcbd434f0ebd768 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 7 Apr 2026 16:31:43 +0200 Subject: [PATCH] swscale/ops: add assertion that comps_src is sane This assertion guards against bugs like that fixed in the previous commit. Signed-off-by: Niklas Haas --- libswscale/ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libswscale/ops.c b/libswscale/ops.c index 0d792a86ec..c993e9eb58 100644 --- a/libswscale/ops.c +++ b/libswscale/ops.c @@ -338,6 +338,7 @@ void ff_sws_op_list_update_comps(SwsOpList *ops) * other components are explicitly stripped */ for (int i = 0; i < op->rw.elems; i++) { const int idx = op->rw.packed ? i : ops->plane_src[i]; + av_assert0(!(ops->comps_src.flags[idx] & SWS_COMP_GARBAGE)); op->comps.flags[i] = ops->comps_src.flags[idx]; op->comps.min[i] = ops->comps_src.min[idx]; op->comps.max[i] = ops->comps_src.max[idx];