[FFmpeg-cvslog] libswscale/utils: Fix bayer to yuvj

Michael Niedermayer git at videolan.org
Sun Apr 14 04:43:36 EEST 2024


ffmpeg | branch: release/6.1 | Michael Niedermayer <michael at niedermayer.cc> | Tue Feb 20 03:32:38 2024 +0100| [abd835bec748c0a39fa47bab75c14250e537a7cf] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit e9cc9e492f987ce23ce8c514258a17952dd20401)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=abd835bec748c0a39fa47bab75c14250e537a7cf
---

 libswscale/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index e6eab0c4c1..d78a6d50ff 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1730,7 +1730,8 @@ static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter,
     /* unscaled special cases */
     if (unscaled && !usesHFilter && !usesVFilter &&
         (c->srcRange == c->dstRange || isAnyRGB(dstFormat) ||
-         isFloat(srcFormat) || isFloat(dstFormat))){
+         isFloat(srcFormat) || isFloat(dstFormat) || isBayer(srcFormat))){
+
         ff_get_unscaled_swscale(c);
 
         if (c->convert_unscaled) {



More information about the ffmpeg-cvslog mailing list