From 302ca6b20ed01ac584f5b15d5bca3d3a92b7a77a Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Wed, 28 Jan 2015 14:41:01 +0000 Subject: [PATCH] mpegvideo_enc: initialize the encoding context This prevents several uninitialized variable uses that take place towards the end of encoding. CC: libav-stable@libav.org Bug-Id: CID 700760 --- libavcodec/mpegvideo_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index be6fb08260..9e155b0c42 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -2538,7 +2538,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ int mb_x, mb_y, pdif = 0; int chr_h= 16>>s->chroma_y_shift; int i, j; - MpegEncContext best_s, backup_s; + MpegEncContext best_s = { 0 }, backup_s; uint8_t bit_buf[2][MAX_MB_BYTES]; uint8_t bit_buf2[2][MAX_MB_BYTES]; uint8_t bit_buf_tex[2][MAX_MB_BYTES];