summaryrefslogtreecommitdiff
path: root/libavcodec/qsvdec.c
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2016-12-05 10:20:26 -0800
committerTimothy Gu <timothygu99@gmail.com>2016-12-06 13:21:08 -0800
commitb6f80b16d1a82463a77352b8756e1cdcaa3a33d0 (patch)
treeecbb0302f3eb57670c63af065a74948e33bad078 /libavcodec/qsvdec.c
parent16a75304fe42d3a007c78126b6370c94ccf891f6 (diff)
qsvdec: Fix memory leak
Fixes CID1396851.
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r--libavcodec/qsvdec.c4
1 files changed, 3 insertions, 1 deletions
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);