From b6f80b16d1a82463a77352b8756e1cdcaa3a33d0 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Mon, 5 Dec 2016 10:20:26 -0800 Subject: [PATCH] qsvdec: Fix memory leak Fixes CID1396851. --- libavcodec/qsvdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index ea4abfa5f0..258042d0e7 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);