]> git.sesse.net Git - ffmpeg/commitdiff
qsvdec: Fix memory leak on error
authorTimothy Gu <timothygu99@gmail.com>
Mon, 5 Dec 2016 18:21:11 +0000 (10:21 -0800)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Thu, 8 Dec 2016 20:53:58 +0000 (15:53 -0500)
Bug-Id: CID 1396851
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
libavcodec/qsvdec.c

index b6fead0b8428b65dcb17d84893d022621eca4f27..b83b0fcda82f3c2c5aa7326359c29963139f90e3 100644 (file)
@@ -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);