Message ID | 20170622185557.1176-1-jamrial@gmail.com |
---|---|
State | Accepted |
Commit | 505cb8e390f275830f5f387020207aaf267be800 |
Headers | show |
On 6/22/17, James Almer <jamrial@gmail.com> wrote: > 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 <jamrial@gmail.com> > --- > libavformat/oggenc.c | 2 ++ > 1 file changed, 2 insertions(+) > lgtm
On 6/22/2017 4:06 PM, Paul B Mahol wrote: > On 6/22/17, James Almer <jamrial@gmail.com> wrote: >> 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 <jamrial@gmail.com> >> --- >> libavformat/oggenc.c | 2 ++ >> 1 file changed, 2 insertions(+) >> > > lgtm Pushed, thanks.
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 ||
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 <jamrial@gmail.com> --- libavformat/oggenc.c | 2 ++ 1 file changed, 2 insertions(+)