Commit 3a84081c authored by James Almer's avatar James Almer

avcodec/librav1e: free the RaPacket after using it

Fixes leaks.
Reviewed-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent d8bf2445
...@@ -508,12 +508,12 @@ retry: ...@@ -508,12 +508,12 @@ retry:
pkt->flags |= AV_PKT_FLAG_KEY; pkt->flags |= AV_PKT_FLAG_KEY;
pkt->pts = pkt->dts = rpkt->input_frameno * avctx->ticks_per_frame; pkt->pts = pkt->dts = rpkt->input_frameno * avctx->ticks_per_frame;
rav1e_packet_unref(rpkt);
if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
int ret = av_bsf_send_packet(ctx->bsf, pkt); int ret = av_bsf_send_packet(ctx->bsf, pkt);
if (ret < 0) { if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "extradata extraction send failed.\n"); av_log(avctx, AV_LOG_ERROR, "extradata extraction send failed.\n");
rav1e_packet_unref(rpkt);
av_packet_unref(pkt); av_packet_unref(pkt);
return ret; return ret;
} }
...@@ -521,7 +521,6 @@ retry: ...@@ -521,7 +521,6 @@ retry:
ret = av_bsf_receive_packet(ctx->bsf, pkt); ret = av_bsf_receive_packet(ctx->bsf, pkt);
if (ret < 0) { if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "extradata extraction receive failed.\n"); av_log(avctx, AV_LOG_ERROR, "extradata extraction receive failed.\n");
rav1e_packet_unref(rpkt);
av_packet_unref(pkt); av_packet_unref(pkt);
return ret; return ret;
} }
......
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