avformat/oggdec: Fix metadata memleak on multiple headers

Fixes: Chromium bug 800123
Reported-by: Matt Wolenetz <wolenetz@google.com>
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2018-03-06 18:14:12 +01:00
parent 3934aa495d
commit da069e9c68
1 changed files with 4 additions and 1 deletions

View File

@ -128,7 +128,10 @@ static int ogg_restore(AVFormatContext *s)
ogg->state = ost->next;
for (i = 0; i < ogg->nstreams; i++) {
av_freep(&ogg->streams[i].buf);
struct ogg_stream *stream = &ogg->streams[i];
av_freep(&stream->buf);
av_freep(&stream->new_metadata);
if (i >= ost->nstreams || !ost->streams[i].private) {
free_stream(s, i);
}