Commit 22522d9c authored by Anton Khirnov's avatar Anton Khirnov

qsvdec: fix a memleak of async_fifo

init() is called whenever format changes, so current code would leak the
fifo in this case.
parent aa9d15d8
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment