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:
authorJames Almer <jamrial@gmail.com>2017-06-22 21:51:28 +0300
committerJames Almer <jamrial@gmail.com>2017-06-22 22:12:51 +0300
commit505cb8e390f275830f5f387020207aaf267be800 (patch)
treeda50da03759a4f8edec77270a88ab869c1911f02 /libavformat/oggenc.c
parent067e42b851a707924a154c4757516cc488985eb3 (diff)
avformat/oggenc: check for stream private data in ogg_free()
Fixes a NULL pointer derefence when ogg_init() returns a failure and a stream's private data was not yet allocated. This is a regression since 3c5a53cdfa099bba8bd951f95b85727b4b3b5d68 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/oggenc.c')
-rw-r--r--libavformat/oggenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 7c1115afd6..10c4eda062 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -743,6 +743,8 @@ static void ogg_free(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
OGGStreamContext *oggstream = st->priv_data;
+ if (!oggstream)
+ continue;
if (st->codecpar->codec_id == AV_CODEC_ID_FLAC ||
st->codecpar->codec_id == AV_CODEC_ID_SPEEX ||
st->codecpar->codec_id == AV_CODEC_ID_OPUS ||