lavf/utils.c: Avoid a null pointer dereference on oom after duration_error allocation.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Wed, 10 Jul 2013 11:15:57 +0000 (13:15 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Wed, 10 Jul 2013 14:20:40 +0000 (16:20 +0200)
libavformat/utils.c

index f607be7..77f04f1 100644 (file)
@@ -2857,6 +2857,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
 
                 if (!st->info->duration_error)
                     st->info->duration_error = av_mallocz(sizeof(st->info->duration_error[0])*2);
+                if (!st->info->duration_error)
+                    return AVERROR(ENOMEM);
 
 //                 if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
 //                     av_log(NULL, AV_LOG_ERROR, "%f\n", dts);