1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

qsvdec: fix a memleak of async_fifo

init() is called whenever format changes, so current code would leak the
fifo in this case.
This commit is contained in:
Anton Khirnov 2015-07-21 19:41:59 +02:00
parent aa9d15d89b
commit 22522d9c2c

View File

@ -73,10 +73,12 @@ int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, mfxSession session)
mfxVideoParam param = { { 0 } };
int ret;
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) {