]> git.sesse.net Git - ffmpeg/commitdiff
mpegvideo_enc: Check AVCodecContext allocation
authorVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 11 Mar 2015 19:46:29 +0000 (19:46 +0000)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Thu, 12 Mar 2015 15:29:59 +0000 (15:29 +0000)
libavcodec/mpegvideo_enc.c

index 38c42fe19210f2fa6c5154987dea688ac6f338b7..e453ba54229d495d9749381b601d3726d4b8ed22 100644 (file)
@@ -1136,6 +1136,8 @@ static int estimate_best_b_count(MpegEncContext *s)
     int64_t best_rd  = INT64_MAX;
     int best_b_count = -1;
 
+    if (!c)
+        return AVERROR(ENOMEM);
     assert(scale >= 0 && scale <= 3);
 
     //emms_c();