summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-10-20 23:38:05 -0300
committerJames Almer <jamrial@gmail.com>2019-10-21 17:20:58 -0300
commitcecf29eb1c41b9582355450fd505d865297ae82e (patch)
tree50982c8ecdb39df849082c3ad387c78394656361 /libavformat
parentaeb8b65cdf3ede71d0c0781585b2f25aaa864a47 (diff)
downloadffmpeg-streaming-cecf29eb1c41b9582355450fd505d865297ae82e.zip
ffmpeg-streaming-cecf29eb1c41b9582355450fd505d865297ae82e.tar.gz
avformat/oggenc: free buffered page lists while uninitializing the muxer
If the trailer is never writen, there could be buffered pages that would leak. Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/oggenc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 06021c4..d3ae073 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -740,6 +740,8 @@ static int ogg_write_trailer(AVFormatContext *s)
static void ogg_free(AVFormatContext *s)
{
+ OGGContext *ogg = s->priv_data;
+ OGGPageList *p = ogg->page_list;
int i;
for (i = 0; i < s->nb_streams; i++) {
@@ -756,6 +758,13 @@ static void ogg_free(AVFormatContext *s)
av_freep(&oggstream->header[1]);
av_freep(&st->priv_data);
}
+
+ while (p) {
+ OGGPageList *next = p->next;
+ av_free(p);
+ p = next;
+ }
+ ogg->page_list = NULL;
}
#if CONFIG_OGG_MUXER
OpenPOWER on IntegriCloud