mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/utils: check for malloc failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ce35a61399
commit
a66893ac94
|
@ -3652,6 +3652,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
|
|||
st->info->last_dts = AV_NOPTS_VALUE;
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue