[libav-commits] Initialize some variables to shut up compiler warnings

Diego Biurrun git at libav.org
Tue Jul 24 00:47:23 CEST 2012


Module: libav
Branch: master
Commit: 0065a92b7ce45d6074d64102a898bcee6c839400

Author:    Diego Biurrun <diego at biurrun.de>
Committer: Diego Biurrun <diego at biurrun.de>
Date:      Tue Apr  3 13:48:56 2012 +0200

Initialize some variables to shut up compiler warnings

---

 libavcodec/aaccoder.c      |    2 +-
 libavcodec/bmp.c           |    2 +-
 libavcodec/dvdsubdec.c     |    2 +-
 libavcodec/mmvideo.c       |    2 +-
 libavcodec/motion_est.c    |    4 ++--
 libavcodec/mpegvideo_enc.c |    2 +-
 libavcodec/vc1dec.c        |    4 ++--
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index c2b0e24..58a8e42 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -962,7 +962,7 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
                 int quant_max;
 
                 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
-                    int b;
+                    int b = 0;
                     dist += quantize_band_cost(s, coefs + w2*128,
                                                scaled + w2*128,
                                                sce->ics.swb_sizes[g],
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index df947a0..9db6518 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -48,7 +48,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
     BiCompression comp;
     unsigned int ihsize;
     int i, j, n, linesize;
-    uint32_t rgb[3];
+    uint32_t rgb[3] = { 0 };
     uint8_t *ptr;
     int dsize;
     const uint8_t *buf0 = buf;
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 78203d0..d566583 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -165,7 +165,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
     int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos;
     int big_offsets, offset_size, is_8bit = 0;
     const uint8_t *yuv_palette = 0;
-    uint8_t colormap[4], alpha[256];
+    uint8_t colormap[4] = { 0 }, alpha[256];
     int date;
     int i;
     int is_menu = 0;
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index 1a9dfdd..48f3c30 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -125,7 +125,7 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
  */
 static int mm_decode_inter(MmContext * s, int half_horiz, int half_vert)
 {
-    int data_off = bytestream2_get_le16(&s->gb), y;
+    int data_off = bytestream2_get_le16(&s->gb), y = 0;
     GetByteContext data_ptr;
 
     if (bytestream2_get_bytes_left(&s->gb) < data_off)
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index ce802e5..e6c046b 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -575,7 +575,7 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift)
     const int size= 1;
     const int h=8;
     int block;
-    int P[10][2];
+    int P[10][2] = { { 0 } };
     int dmin_sum=0, mx4_sum=0, my4_sum=0;
     int same=1;
     const int stride= c->stride;
@@ -725,7 +725,7 @@ static int interlaced_search(MpegEncContext *s, int ref_index,
     const int size=0;
     const int h=8;
     int block;
-    int P[10][2];
+    int P[10][2] = { { 0 } };
     uint8_t * const mv_penalty= c->current_mv_penalty;
     int same=1;
     const int stride= 2*s->linesize;
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index f88df92..24094c0 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2708,7 +2708,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
                 if ((s->mpv_flags & FF_MPV_FLAG_QP_RD) && dmin < INT_MAX) {
                     if(best_s.mv_type==MV_TYPE_16X16){ //FIXME move 4mv after QPRD
                         const int last_qp= backup_s.qscale;
-                        int qpi, qp, dc[6];
+                        int qpi, qp, dc[6] = { 0 };
                         DCTELEM ac[6][16];
                         const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0;
                         static const int dquant_tab[4]={-1,1,-2,2};
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 51124cf..19c4f20 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -3902,7 +3902,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v)
     int val; /* temp values */
     int first_block = 1;
     int dst_idx, off;
-    int pred_flag;
+    int pred_flag = 0;
     int block_cbp = 0, pat, block_tt = 0;
     int idx_mbmode = 0;
 
@@ -3961,7 +3961,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v)
             v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1);
             for (i = 0; i < 6; i++) {
                 if (i < 4) {
-                    dmv_x = dmv_y = pred_flag = 0;
+                    dmv_x = dmv_y = 0;
                     val   = ((v->fourmvbp >> (3 - i)) & 1);
                     if (val) {
                         get_mvdata_interlaced(v, &dmv_x, &dmv_y, &pred_flag);



More information about the libav-commits mailing list