From b8fa549227367701532c8953b5da3d09065b42ac Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Fri, 4 Oct 2024 01:30:57 +0800 Subject: [PATCH] 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 Signed-off-by: Paul B Mahol --- libavcodec/mediacodecenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c index 4f1078402d..5e91841044 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;