X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Foggenc.c;h=d3ae07351d01789aa011992686b5b0abc6441111;hb=632b8298b70969f6ab43509fd276b33295d9e336;hp=06021c4f4ba835156a229a794ce8e8e0abd3ec46;hpb=79025da3f2e7ab047c8f3c0c817952a98480b26b;p=ffmpeg diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 06021c4f4ba..d3ae07351d0 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