[FFmpeg-devel] [PATCH] libavcodec/v4l2_m2m_enc:free v4l2 encode session properly when initialiZzation fails Fix ticket 8285 bug

Colin NG colin_ng at hotmail.com
Tue Oct 22 02:01:30 EEST 2019


---
 libavcodec/v4l2_m2m_enc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 474e6bef89..17fc3d30cf 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -312,6 +312,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;
     }
     s->avctx = avctx;
-- 
2.17.1



More information about the ffmpeg-devel mailing list