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@tencent.com>
(cherry picked from commit eff9ed7bff)
release/7.1
Zhao Zhili 3 months ago
parent 8be6e56a53
commit 4c0ef3bfae
  1. 2
      libavcodec/mediacodecenc.c

@ -134,7 +134,7 @@ static int extract_extradata_support(AVCodecContext *avctx)
static int mediacodec_init_bsf(AVCodecContext *avctx) static int mediacodec_init_bsf(AVCodecContext *avctx)
{ {
MediaCodecEncContext *s = avctx->priv_data; MediaCodecEncContext *s = avctx->priv_data;
char str[128]; char str[128] = {0};
int ret; int ret;
int crop_right = s->width - avctx->width; int crop_right = s->width - avctx->width;
int crop_bottom = s->height - avctx->height; int crop_bottom = s->height - avctx->height;

Loading…
Cancel
Save