]> git.sesse.net Git - ffmpeg/commitdiff
mpegvideo_enc: initialize the encoding context
authorVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 28 Jan 2015 14:41:01 +0000 (14:41 +0000)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Thu, 29 Jan 2015 15:26:33 +0000 (15:26 +0000)
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

index be6fb0826001a67fdb4866d6dd64fdd6fb1cf73c..9e155b0c42208d72bf27ab55984801fb4c0ab7a4 100644 (file)
@@ -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];