[FFmpeg-cvslog] avcodec/libkvazaar: Increase array size

Andreas Rheinhardt git at videolan.org
Wed Jan 12 02:50:12 EET 2022


ffmpeg | branch: release/4.4 | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Dec  6 12:19:46 2021 +0100| [d1f7a44e89fa90748a71c7d714c53036a2a44800] | committer: Andreas Rheinhardt

avcodec/libkvazaar: Increase array size

av_image_copy() expects an array of four pointers according to its
declaration; although it currently only touches pointers that
are actually in use (depending upon the pixel format) this might
change at any time (as has already happened for the linesizes
in d7bc52bf456deba0f32d9fe5c288ec441f1ebef5).

This fixes a -Wstringop-overflow= warning with GCC 11.2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
(cherry picked from commit b09ea67b40e342f5e4183e9ebc0c14801ecd218c)

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

 libavcodec/libkvazaar.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 4432649853..7389265415 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -210,13 +210,19 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 
         // Copy pixels from frame to input_pic.
         {
+            uint8_t *dst[4] = {
+                input_pic->data[0],
+                input_pic->data[1],
+                input_pic->data[2],
+                NULL,
+            };
             int dst_linesizes[4] = {
               frame->width,
               frame->width / 2,
               frame->width / 2,
               0
             };
-            av_image_copy(input_pic->data, dst_linesizes,
+            av_image_copy(dst, dst_linesizes,
                           (const uint8_t **)frame->data, frame->linesize,
                           frame->format, frame->width, frame->height);
         }



More information about the ffmpeg-cvslog mailing list