summaryrefslogtreecommitdiff
path: root/libavcodec/qsvdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-25 23:28:39 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-25 23:28:39 +0200
commitc3413a712ac23d74a7a0474a6100753d538b79cd (patch)
tree9907918d9f67577146990f2393a64163e28445be /libavcodec/qsvdec.c
parentef2a85ac532117b13087f3ceabeb450f12d26c7e (diff)
parent22522d9c2c69624fe4d81d61ee65a56610f22f1d (diff)
Merge commit '22522d9c2c69624fe4d81d61ee65a56610f22f1d'
* commit '22522d9c2c69624fe4d81d61ee65a56610f22f1d': qsvdec: fix a memleak of async_fifo Conflicts: libavcodec/qsvdec.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r--libavcodec/qsvdec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 37cbb03020..036015f751 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -125,10 +125,12 @@ int ff_qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt)
HEVC which is 16 for both cases.
So weare pre-allocating fifo big enough for 17 elements:
*/
- q->async_fifo = av_fifo_alloc((1 + 16) *
- (sizeof(mfxSyncPoint) + sizeof(QSVFrame*)));
- if (!q->async_fifo)
- return AVERROR(ENOMEM);
+ if (!q->async_fifo) {
+ q->async_fifo = av_fifo_alloc((1 + 16) *
+ (sizeof(mfxSyncPoint) + sizeof(QSVFrame*)));
+ if (!q->async_fifo)
+ return AVERROR(ENOMEM);
+ }
q->input_fifo = av_fifo_alloc(1024*16);
if (!q->input_fifo)