diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index b6fead0b8428b65dcb17d84893d022621eca4f27..b83b0fcda82f3c2c5aa7326359c29963139f90e3 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);