diff mbox series

[FFmpeg-devel,3/3] swscale/utils: don't early return in yuv alpha blendaway

Message ID 20231113153234.8812-3-ffmpeg@haasn.xyz
State New
Headers show
Series [FFmpeg-devel,1/3] swscale: don't assign range converters for float | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Niklas Haas Nov. 13, 2023, 3:32 p.m. UTC
From: Niklas Haas <git@haasn.dev>

If changing YUV range after init results in the special converter no
longer being picked, then we need the rest of the init function to have
been hit.

Fixes: cedf589c09c567b72bf4c1a58db53d94622567e1
---
 libswscale/utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 7ce86f83ea..294b0b5ace 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1721,7 +1721,9 @@  static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter,
             av_log(c, AV_LOG_INFO,
                     "alpha blendaway %s -> %s special converter is available\n",
                     av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat));
-        return 0;
+
+        if (isAnyRGB(dstFormat))
+            return 0;
     }
 
     /* unscaled special cases */