Commit 069eea16 authored by Chris Cunningham's avatar Chris Cunningham Committed by 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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 542f7259)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 79181b97
...@@ -701,6 +701,7 @@ static int ogg_read_header(AVFormatContext *s) ...@@ -701,6 +701,7 @@ static int ogg_read_header(AVFormatContext *s)
if (ogg->streams[i].header < 0) { if (ogg->streams[i].header < 0) {
av_log(s, AV_LOG_ERROR, "Header parsing failed for stream %d\n", i); av_log(s, AV_LOG_ERROR, "Header parsing failed for stream %d\n", i);
ogg->streams[i].codec = NULL; ogg->streams[i].codec = NULL;
av_freep(&ogg->streams[i].private);
} else if (os->codec && os->nb_header < os->codec->nb_header) { } else if (os->codec && os->nb_header < os->codec->nb_header) {
av_log(s, AV_LOG_WARNING, av_log(s, AV_LOG_WARNING,
"Headers mismatch for stream %d: " "Headers mismatch for stream %d: "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment