Commit b64fe493 authored by Hendrik Leppkes's avatar Hendrik Leppkes

avformat: always unref the packet after parsing

This fixes a memory leak when side-data is present.
parent 83d20a6a
...@@ -1285,12 +1285,11 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index) ...@@ -1285,12 +1285,11 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
compute_pkt_fields(s, st, st->parser, &out_pkt, next_dts, next_pts); compute_pkt_fields(s, st, st->parser, &out_pkt, next_dts, next_pts);
if ((ret = add_to_pktbuf(&s->internal->parse_queue, &out_pkt, ret = add_to_pktbuf(&s->internal->parse_queue, &out_pkt,
&s->internal->parse_queue_end, &s->internal->parse_queue_end, 1);
1))) { av_packet_unref(&out_pkt);
av_packet_unref(&out_pkt); if (ret < 0)
goto fail; goto fail;
}
} }
/* end of the stream => close and free the parser */ /* end of the stream => close and free the parser */
......
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