summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-11-01 09:47:34 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-11-02 09:03:56 +0100
commitb64fe493717cb2f05a019d9f13778382a78d9d0a (patch)
tree3e960ca5ded5d6b0e1d7729865a8d50805eb7c86 /libavformat/utils.c
parent83d20a6a7e8fb4ae31b5336ea06f093f9f5d1e5c (diff)
avformat: always unref the packet after parsing
This fixes a memory leak when side-data is present.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 7e4f54f843..3f82659398 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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);
- if ((ret = add_to_pktbuf(&s->internal->parse_queue, &out_pkt,
- &s->internal->parse_queue_end,
- 1))) {
- av_packet_unref(&out_pkt);
+ ret = add_to_pktbuf(&s->internal->parse_queue, &out_pkt,
+ &s->internal->parse_queue_end, 1);
+ av_packet_unref(&out_pkt);
+ if (ret < 0)
goto fail;
- }
}
/* end of the stream => close and free the parser */