Commit 60c8273b35 for ffmpeg
commit 60c8273b35762d6fdd0f70c451cba5a12b2d8e72
Author: Niklas Haas <git@haasn.dev>
Date: Fri Oct 9 18:08:58 2026 +0200
swscale/tests/swscale: don't bail on ENOTSUP in auxiliary conversions
Somebody thought it was a good idea to implement XYZ<->XYZ but not XYZ<->YUV,
so for an xyz -> xyz conversion, the main check succeeds while just the
auxiliary conversions fail.
Signed-off-by: Niklas Haas <git@haasn.dev>
diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
index e639571506..70ea5de2e1 100644
--- a/libswscale/tests/swscale.c
+++ b/libswscale/tests/swscale.c
@@ -618,11 +618,8 @@ static int run_test(enum AVPixelFormat src_fmt, enum AVPixelFormat dst_fmt,
ret = (opts->api == IMPL_LEGACY) ? scale_legacy(dst, src, mode, opts, &r.time)
: hw_device_ctx ? scale_hw(dst, src, mode, opts, &r.time)
: scale_new(dst, src, mode, opts, &r.time);
- if (ret < 0) {
- if (ret == AVERROR(ENOTSUP))
- ret = 0;
+ if (ret < 0)
goto error;
- }
ret = init_frame(&out, ref, ref->width, ref->height, ref->format);
if (ret < 0)
@@ -670,6 +667,8 @@ bad_loss:
error:
av_frame_free(&dst);
av_frame_free(&out);
+ if (ret == AVERROR(ENOTSUP))
+ ret = 0;
return ret;
}