diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2013-09-16 15:51:46 -0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-09-29 17:54:25 +0000 |
commit | 19133e96d30e3f80dbae236ef081aedef419a6bf (patch) | |
tree | 67c997559245ad39f11aad7eba83664a104216b9 | |
parent | 2cd7c99498b1bcb450c328459cf85a686ce83456 (diff) | |
download | ffmpeg-19133e96d30e3f80dbae236ef081aedef419a6bf.tar.gz |
lavf: fix memleaks in avformat_find_stream_info()
When AVFMT_FLAG_NOBUFFER is set, the packets are not added to the
AVFormatContext packet list, so they need to be freed when they are
no longer needed.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index faad9c9db4..8757c101a3 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2228,6 +2228,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) AV_TIME_BASE_Q) >= ic->max_analyze_duration) { av_log(ic, AV_LOG_WARNING, "max_analyze_duration %d reached\n", ic->max_analyze_duration); + if (ic->flags & AVFMT_FLAG_NOBUFFER) + av_packet_unref(pkt); break; } } @@ -2256,6 +2258,9 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) try_decode_frame(st, pkt, (options && i < orig_nb_streams) ? &options[i] : NULL); + if (ic->flags & AVFMT_FLAG_NOBUFFER) + av_packet_unref(pkt); + st->codec_info_nb_frames++; count++; } |