summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2016-12-05 10:21:11 -0800
committerVittorio Giovara <vittorio.giovara@gmail.com>2016-12-08 15:53:58 -0500
commitd32bdadda86b35c2960e4de877cf081b9d2dadb3 (patch)
treebf5f0354e46ef7d8b6f6e1d5090885c588327edd /libavcodec
parent6a93b596c5c3af31b843d63013a7985ffeea354d (diff)
qsvdec: Fix memory leak on error
Bug-Id: CID 1396851 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/qsvdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index b6fead0b84..b83b0fcda8 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -306,8 +306,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);