oggenc: check return value of av_mallocz()

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
James Almer 2014-04-04 03:19:59 -03:00 committed by Michael Niedermayer
parent 35617366b5
commit 0f62982335
1 changed files with 3 additions and 0 deletions

View File

@ -427,6 +427,9 @@ static int ogg_write_header(AVFormatContext *s)
return -1;
}
oggstream = av_mallocz(sizeof(*oggstream));
if (!oggstream)
return AVERROR(ENOMEM);
oggstream->page.stream_index = i;
if (!(st->codec->flags & CODEC_FLAG_BITEXACT))