projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83d20a6
)
avformat: always unref the packet after parsing
author
Hendrik Leppkes
<h.leppkes@gmail.com>
Sun, 1 Nov 2015 08:47:34 +0000
(09:47 +0100)
committer
Hendrik Leppkes
<h.leppkes@gmail.com>
Mon, 2 Nov 2015 08:03:56 +0000
(09:03 +0100)
This fixes a memory leak when side-data is present.
libavformat/utils.c
patch
|
blob
|
history
diff --git
a/libavformat/utils.c
b/libavformat/utils.c
index
7e4f54f
..
3f82659
100644
(file)
--- 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 */