diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-07-21 20:41:59 +0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-07-25 18:23:46 +0300 |
commit | 22522d9c2c69624fe4d81d61ee65a56610f22f1d (patch) | |
tree | 17efc65a647e662657845f2a1e8c4a7d64f87bb8 /libavcodec | |
parent | aa9d15d89bb4ee8a31607d3db1b8c5334eb88d2d (diff) |
qsvdec: fix a memleak of async_fifo
init() is called whenever format changes, so current code would leak the
fifo in this case.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/qsvdec.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 489375cf7b..ef781d9d8e 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -73,10 +73,12 @@ int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, mfxSession session) mfxVideoParam param = { { 0 } }; int ret; - q->async_fifo = av_fifo_alloc((1 + q->async_depth) * - (sizeof(mfxSyncPoint) + sizeof(QSVFrame*))); - if (!q->async_fifo) - return AVERROR(ENOMEM); + if (!q->async_fifo) { + q->async_fifo = av_fifo_alloc((1 + q->async_depth) * + (sizeof(mfxSyncPoint) + sizeof(QSVFrame*))); + if (!q->async_fifo) + return AVERROR(ENOMEM); + } ret = qsv_init_session(avctx, q, session); if (ret < 0) { |