diff mbox series

[FFmpeg-devel,1/2] avcodec/v4l2_m2m_enc: Fix leak when device init fails

Message ID 20200310045541.13048-1-andriy.gelman@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,1/2] avcodec/v4l2_m2m_enc: Fix leak when device init fails
Related show


Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andriy Gelman March 10, 2020, 4:55 a.m. UTC
From: Colin NG <colin_ng@hotmail.com>

Fixes ticket #8285

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>

This was sent to the mailing list by Colin NG some time ago, but was never

 libavcodec/v4l2_m2m_enc.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series


diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index c9f1741bfd0..ff9ff267ea2 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -316,6 +316,7 @@  static av_cold int v4l2_encode_init(AVCodecContext *avctx)
     ret = ff_v4l2_m2m_codec_init(priv);
     if (ret) {
         av_log(avctx, AV_LOG_ERROR, "can't configure encoder\n");
+        ff_v4l2_m2m_codec_end(priv);
         return ret;