OSDN Git Service

qsvdec: Fix memory leak
authorTimothy Gu <timothygu99@gmail.com>
Mon, 5 Dec 2016 18:20:26 +0000 (10:20 -0800)
committerTimothy Gu <timothygu99@gmail.com>
Tue, 6 Dec 2016 21:21:08 +0000 (13:21 -0800)
Fixes CID1396851.

libavcodec/qsvdec.c

index ea4abfa..258042d 100644 (file)
@@ -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);