Commit a66893ac authored by wm4's avatar wm4 Committed by Michael Niedermayer

avformat/utils: check for malloc failure

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ce35a613
...@@ -3652,6 +3652,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c) ...@@ -3652,6 +3652,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
st->info->last_dts = AV_NOPTS_VALUE; st->info->last_dts = AV_NOPTS_VALUE;
st->codec = avcodec_alloc_context3(c); st->codec = avcodec_alloc_context3(c);
if (!st->codec) {
av_free(st->info);
av_free(st);
return NULL;
}
if (s->iformat) { if (s->iformat) {
/* no default bitrate if decoding */ /* no default bitrate if decoding */
st->codec->bit_rate = 0; 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