avformat/utils: fix memory leak in avformat_free_context

The pointer to the packet queue is stored in the internal structure
so the queue needs to be flushed before internal is freed.

Signed-off-by: Steven Siloti <ssiloti@bittorrent.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 949debd1d1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Steven Siloti 2017-07-18 11:26:39 -07:00 committed by Michael Niedermayer
parent 8aa32a8d5c
commit fd871e24e6
1 changed files with 1 additions and 1 deletions

View File

@ -4199,8 +4199,8 @@ void avformat_free_context(AVFormatContext *s)
av_dict_free(&s->metadata);
av_dict_free(&s->internal->id3v2_meta);
av_freep(&s->streams);
av_freep(&s->internal);
flush_packet_queue(s);
av_freep(&s->internal);
av_free(s);
}