[FFmpeg-cvslog] swscale/utils: Allocate more dithererror

Michael Niedermayer git at videolan.org
Sun Apr 14 20:34:19 EEST 2024


ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Sat Feb 17 01:04:13 2024 +0100| [c71a9c51e76264da77626abb1de636912aa5b3de] | committer: Michael Niedermayer

swscale/utils: Allocate more dithererror

Fixes: out of array read
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 18f26f8a2f8dc3b9ec3ac3ab8e03fce15cc8c88d)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libswscale/utils.c b/libswscale/utils.c
index cb4f5b521c..f24b05c3d3 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1895,7 +1895,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
     }
 
     for (i = 0; i < 4; i++)
-        if (!FF_ALLOCZ_TYPED_ARRAY(c->dither_error[i], c->dstW + 2))
+        if (!FF_ALLOCZ_TYPED_ARRAY(c->dither_error[i], c->dstW + 3))
             goto nomem;
 
     c->needAlpha = (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat) && isALPHA(c->dstFormat)) ? 1 : 0;



More information about the ffmpeg-cvslog mailing list