[FFmpeg-cvslog] v4l2_m2m: decoder: fix memory leak

Lukas Rusak git at videolan.org
Wed Jun 27 09:43:04 EEST 2018


ffmpeg | branch: master | Lukas Rusak <lorusak at gmail.com> | Tue Jun 26 14:36:46 2018 -0700| [7395f13df94efd349ad29c8b5bb5942b0d44d6e4] | committer: Jorge Ramirez-Ortiz

v4l2_m2m: decoder: fix memory leak

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7395f13df94efd349ad29c8b5bb5942b0d44d6e4
---

 libavcodec/v4l2_m2m_dec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
index 598dc10781..710e40efd8 100644
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -149,11 +149,14 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)
 
     if (avpkt.size) {
         ret = v4l2_try_start(avctx);
-        if (ret)
+        if (ret) {
+            av_packet_unref(&avpkt);
             return 0;
+        }
     }
 
 dequeue:
+    av_packet_unref(&avpkt);
     return ff_v4l2_context_dequeue_frame(capture, frame);
 }
 



More information about the ffmpeg-cvslog mailing list