libswscale/utils: Fix bayer to yuvj

Fixes: out of array access.

Earlier code assumes that a unscaled bayer to yuvj420 converter exists
but the later code then skips yuvj420

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e9cc9e492f987ce23ce8c514258a17952dd20401)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-02-20 03:32:38 +01:00
parent b4a7c55f79
commit 7d3c0fbfba
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -1787,7 +1787,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
/* unscaled special cases */
if (unscaled && !usesHFilter && !usesVFilter &&
(c->srcRange == c->dstRange || isAnyRGB(dstFormat))) {
(c->srcRange == c->dstRange || isAnyRGB(dstFormat) || isBayer(srcFormat))) {
ff_get_unscaled_swscale(c);
if (c->swscale) {