summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-03-11 19:46:29 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-03-12 15:29:59 +0000
commita72d93daa09ffbad2771f1450820941055eaf210 (patch)
tree31f1b2b925fd24a65ae05ed948b5961a2ffcac82 /libavcodec/mpegvideo_enc.c
parent78c892284150e12f6b08b287bdf7e62307c6985f (diff)
mpegvideo_enc: Check AVCodecContext allocation
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 38c42fe192..e453ba5422 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();