[FFmpeg-cvslog] avcodec/mediacodecenc: Fix access of uninitialized value

Zhao Zhili git at videolan.org
Fri Oct 4 10:45:53 EEST 2024


ffmpeg | branch: release/7.1 | Zhao Zhili <zhilizhao at tencent.com> | Fri Oct  4 01:30:57 2024 +0800| [4c0ef3bfae1473902f8ec8ee0a1a95607827b390] | committer: Zhao Zhili

avcodec/mediacodecenc: Fix access of uninitialized value

When crop is skipped, av_strlcatf will access `str` which isn't
initialized properly.

Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>
(cherry picked from commit eff9ed7bff45998ea370e3d6f627529ad47e2e74)

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

 libavcodec/mediacodecenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 6ca3968a24..e76ea81236 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -134,7 +134,7 @@ static int extract_extradata_support(AVCodecContext *avctx)
 static int mediacodec_init_bsf(AVCodecContext *avctx)
 {
     MediaCodecEncContext *s = avctx->priv_data;
-    char str[128];
+    char str[128] = {0};
     int ret;
     int crop_right = s->width - avctx->width;
     int crop_bottom = s->height - avctx->height;



More information about the ffmpeg-cvslog mailing list