aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-01 16:44:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-06-12 12:01:32 +0200
commite5f92f3fbadb29e54ac3ab82cd24d78e95bc286d (patch)
treedd6713986a66dc42e4c3daffc6345452f4007591
parent640e401aedb3c8b77bdbed51f799c97171e4c483 (diff)
downloadffmpeg-e5f92f3fbadb29e54ac3ab82cd24d78e95bc286d.tar.gz
avcodec/v4l2_m2m_dec: Fix memleak on ff_v4l2_m2m_codec_init() failure
Fixes: 13579/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1_V4L2M2M_fuzzer-5753560726241280 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/v4l2_m2m_dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
index 710e40efd8..d0601f0e2f 100644
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -188,7 +188,11 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
ret = ff_v4l2_m2m_codec_init(avctx);
if (ret) {
+ V4L2m2mPriv *priv = avctx->priv_data;
av_log(avctx, AV_LOG_ERROR, "can't configure decoder\n");
+ s->self_ref = NULL;
+ av_buffer_unref(&priv->context_ref);
+
return ret;
}