Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cunningham <chcunningham@chromium.org>2016-05-10 01:27:29 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-05-11 04:50:37 +0300
commit542f725964e52201000ec34e2f23229cf534ad3a (patch)
treebe2a971d5008dcf9b3b0d6475e4aa7a9af0dcdd5 /libavformat/oggdec.c
parentd645182227e8830de4de59a7b9ebec1b7e714d12 (diff)
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@niedermayer.cc>
Diffstat (limited to 'libavformat/oggdec.c')
-rw-r--r--libavformat/oggdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 528d8db551..47a0cbae05 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -701,6 +701,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: "