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

Signed-off-by: James Almer <jamr...@gmail.com>
---
 libavformat/oggenc.c | 2 ++
 1 file changed, 2 insertions(+)

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 ||
-- 
2.13.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to