mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-09-11 09:57:54 +02:00
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>
This commit is contained in:
parent
aeb8b65cdf
commit
cecf29eb1c
@ -740,6 +740,8 @@ static int ogg_write_trailer(AVFormatContext *s)
|
|||||||
|
|
||||||
static void ogg_free(AVFormatContext *s)
|
static void ogg_free(AVFormatContext *s)
|
||||||
{
|
{
|
||||||
|
OGGContext *ogg = s->priv_data;
|
||||||
|
OGGPageList *p = ogg->page_list;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < s->nb_streams; 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(&oggstream->header[1]);
|
||||||
av_freep(&st->priv_data);
|
av_freep(&st->priv_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (p) {
|
||||||
|
OGGPageList *next = p->next;
|
||||||
|
av_free(p);
|
||||||
|
p = next;
|
||||||
|
}
|
||||||
|
ogg->page_list = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_OGG_MUXER
|
#if CONFIG_OGG_MUXER
|
||||||
|
Loading…
Reference in New Issue
Block a user