aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/decode.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-03-23 14:25:24 +0100
committerAnton Khirnov <anton@khirnov.net>2022-05-11 10:37:26 +0200
commit2cb86cd00c64ff16b16920eec37ec5b25a59b284 (patch)
tree5222a07973fdb141df12801a7b9d68850a6069ff /libavcodec/decode.c
parentc954cf1e1b766a0d1992d5be0a8be0055a8e1a6a (diff)
downloadffmpeg-2cb86cd00c64ff16b16920eec37ec5b25a59b284.tar.gz
lavc/avcodec: only allocate decoding packets for decoders
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r--libavcodec/decode.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 909235feb4..264fc66a81 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1527,6 +1527,7 @@ int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
int ff_decode_preinit(AVCodecContext *avctx)
{
+ AVCodecInternal *avci = avctx->internal;
int ret = 0;
/* if the decoder init function was already called previously,
@@ -1605,6 +1606,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
avctx->export_side_data |= AV_CODEC_EXPORT_DATA_MVS;
}
+ avci->in_pkt = av_packet_alloc();
+ avci->last_pkt_props = av_packet_alloc();
+ avci->pkt_props = av_fifo_alloc2(1, sizeof(*avci->last_pkt_props),
+ AV_FIFO_FLAG_AUTO_GROW);
+ if (!avci->in_pkt || !avci->last_pkt_props || !avci->pkt_props)
+ return AVERROR(ENOMEM);
+
ret = decode_bsfs_init(avctx);
if (ret < 0)
return ret;