[FFmpeg-cvslog] libavformat/oggdec: Free stream private when header parsing fails.

Chris Cunningham git at videolan.org
Fri Aug 26 15:40:55 EEST 2016


ffmpeg | branch: release/2.8 | Chris Cunningham <chcunningham at chromium.org> | Mon May  9 15:27:29 2016 -0700| [345231336fd22d23d59fd5c0d969459681b02a6a] | committer: Michael Niedermayer

libavformat/oggdec: Free stream private when header parsing fails.

Leaking this private structure opens up the possibility that it may
be re-used when parsing later packets in the stream. This is
problematic if the later packets are not the same codec type (e.g.
private allocated during Vorbis parsing, but later packets are Opus
and the private is assumed to be the oggopus_private type in
opus_header()).

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 542f725964e52201000ec34e2f23229cf534ad3a)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=345231336fd22d23d59fd5c0d969459681b02a6a
---

 libavformat/oggdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index ae56915..856e0e6 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -700,6 +700,7 @@ static int ogg_read_header(AVFormatContext *s)
         if (ogg->streams[i].header < 0) {
             av_log(s, AV_LOG_ERROR, "Header parsing failed for stream %d\n", i);
             ogg->streams[i].codec = NULL;
+            av_freep(&ogg->streams[i].private);
         } else if (os->codec && os->nb_header < os->codec->nb_header) {
             av_log(s, AV_LOG_WARNING,
                    "Headers mismatch for stream %d: "



More information about the ffmpeg-cvslog mailing list