avformat/utils: check for malloc failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a66893ac949864352b36b39e48c4cd72bbd81e54)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
wm4 2014-12-12 22:22:55 +01:00 committed by Michael Niedermayer
parent edec2a4da3
commit 7caee17204

View File

@ -3650,6 +3650,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;