[FFmpeg-cvslog] mpegvideo_enc: Check AVCodecContext allocation

Vittorio Giovara git at videolan.org
Thu Mar 12 21:39:20 CET 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Wed Mar 11 19:46:29 2015 +0000| [a72d93daa09ffbad2771f1450820941055eaf210] | committer: Vittorio Giovara

mpegvideo_enc: Check AVCodecContext allocation

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a72d93daa09ffbad2771f1450820941055eaf210
---

 libavcodec/mpegvideo_enc.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 38c42fe..e453ba5 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -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();



More information about the ffmpeg-cvslog mailing list