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

Michael Niedermayer git at videolan.org
Mon Apr 15 01:48:29 EEST 2024


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sat Feb 17 01:04:13 2024 +0100| [4f7d68172b55ce895192c786dd94e9ae7c31874a] | 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=4f7d68172b55ce895192c786dd94e9ae7c31874a
---

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

diff --git a/libswscale/utils.c b/libswscale/utils.c
index e48119fdf5..6ed4fc20c9 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1676,7 +1676,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
     }
 
     for (i = 0; i < 4; i++)
-        FF_ALLOCZ_OR_GOTO(c, c->dither_error[i], (c->dstW+2) * sizeof(int), fail);
+        FF_ALLOCZ_OR_GOTO(c, c->dither_error[i], (c->dstW+3) * sizeof(int), fail);
 
     /* Allocate pixbufs (we use dynamic allocation because otherwise we would
      * need to allocate several megabytes to handle all possible cases) */



More information about the ffmpeg-cvslog mailing list