summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-01-18 08:07:40 +0100
committerAnton Khirnov <anton@khirnov.net>2012-01-18 20:10:26 +0100
commitaa2e4bb0580b519156a6a34f1ee71cf063dfcaee (patch)
tree6a0c383e60c6ae70255518b5ef6e9b01c941ad96
parentf97cb4515626228620d7317191c4c32f14eb1a1b (diff)
lavf: free packets for muxers implementing interleave_packet().
Fixes a memleak.
-rw-r--r--libavformat/utils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 373f06831d..b1832ba717 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3218,9 +3218,12 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pk
* < 0 if an error occurred
*/
static int interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, int flush){
- if(s->oformat->interleave_packet)
- return s->oformat->interleave_packet(s, out, in, flush);
- else
+ if (s->oformat->interleave_packet) {
+ int ret = s->oformat->interleave_packet(s, out, in, flush);
+ if (in)
+ av_free_packet(in);
+ return ret;
+ } else
return av_interleave_packet_per_dts(s, out, in, flush);
}