mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-03 14:32:16 +02:00
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>
This commit is contained in:
parent
067e42b851
commit
505cb8e390
@ -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 ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user