Signed-off-by: James Almer <[email protected]>
---
libavcodec/mmaldec.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index cb15ac072a..ed51d74de5 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -776,12 +776,17 @@ static int ffmmal_decode(AVCodecContext *avctx, void
*data, int *got_frame,
int ret = 0;
if (avctx->extradata_size && !ctx->extradata_sent) {
- AVPacket pkt = {0};
- av_init_packet(&pkt);
- pkt.data = avctx->extradata;
- pkt.size = avctx->extradata_size;
+ AVPacket *pkt;
+
+ pkt = av_packet_alloc();
+ if (!pkt)
+ return AVERROR(ENOMEM);
+ pkt->data = avctx->extradata;
+ pkt->size = avctx->extradata_size;
ctx->extradata_sent = 1;
- if ((ret = ffmmal_add_packet(avctx, &pkt, 1)) < 0)
+ ret = ffmmal_add_packet(avctx, pkt, 1);
+ av_packet_free(&pkt);
+ if (ret < 0)
return ret;
}
--
2.30.1
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".