Commit a20ae16999 for ffmpeg
commit a20ae169999a86061d2e834d39733d20a4311bd3
Author: Niklas Haas <git@haasn.dev>
Date: Fri Oct 9 17:52:19 2026 +0200
swscale/format: reject XYZ<->RGB conversions
Fixes: 2ed5830108f92093cffb696e88706f970ce6bc6b
Signed-off-by: Niklas Haas <git@haasn.dev>
diff --git a/libswscale/format.c b/libswscale/format.c
index 5484e8180c..a6530c2cd3 100644
--- a/libswscale/format.c
+++ b/libswscale/format.c
@@ -1837,6 +1837,11 @@ int ff_sws_op_list_generate(SwsContext *ctx, const SwsFormat *src,
ctx->alpha_blend != SWS_ALPHA_BLEND_NONE)
return AVERROR(ENOTSUP);
+ /* XYZ<->RGB conversion requires application of a gamma function which
+ * are not currently implemented */
+ if ((src->desc->flags ^ dst->desc->flags) & AV_PIX_FMT_FLAG_XYZ)
+ return AVERROR(ENOTSUP);
+
SwsOpList *ops = ff_sws_op_list_alloc();
if (!ops)
return AVERROR(ENOMEM);
diff --git a/tests/ref/fate/sws-ops-list b/tests/ref/fate/sws-ops-list
index 59913a43f1..94a583b190 100644
--- a/tests/ref/fate/sws-ops-list
+++ b/tests/ref/fate/sws-ops-list
@@ -1 +1 @@
-1f03295f230be02367e812f3670230cc
+c49b616409175c41ccc5d786c5097f96