[FFmpeg-cvslog] qsvdec: Fix memory leak

Timothy Gu git at videolan.org
Tue Dec 6 23:22:25 EET 2016


ffmpeg | branch: master | Timothy Gu <timothygu99 at gmail.com> | Mon Dec  5 10:20:26 2016 -0800| [b6f80b16d1a82463a77352b8756e1cdcaa3a33d0] | committer: Timothy Gu

qsvdec: Fix memory leak

Fixes CID1396851.

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

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

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index ea4abfa..258042d 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -305,8 +305,10 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
 
     do {
         ret = get_surface(avctx, q, &insurf);
-        if (ret < 0)
+        if (ret < 0) {
+            av_freep(&sync);
             return ret;
+        }
 
         ret = MFXVideoDECODE_DecodeFrameAsync(q->session, avpkt->size ? &bs : NULL,
                                               insurf, &outsurf, sync);



More information about the ffmpeg-cvslog mailing list