Commit 9f810a9b authored by Martin Storsjö's avatar Martin Storsjö

libavformat: Check for malloc failures in avformat_new_stream

CC: libav-stable@libav.org
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent c4aa0f86
......@@ -2525,6 +2525,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
}
st->codec = avcodec_alloc_context3(c);
if (!st->codec) {
av_free(st->info);
av_free(st);
return NULL;
}
if (s->iformat) {
/* no default bitrate if decoding */
st->codec->bit_rate = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment