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)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 11 Jul 2013 10:06:56 +0000 (12:06 +0200)
(cherry picked from commit c9eb5c9751c88caaed62af5ffe908fe545022e7e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index bdee644..070c224 100644 (file)
@@ -2859,6 +2859,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);