]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/4xm.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / 4xm.c
index f886e3e7a5c0c6ac7a3764302986f2758b42da8b..600cf81ccde3201ee54af6e78c0135a13dc6c7da 100644 (file)
@@ -281,7 +281,7 @@ static void init_mv(FourXContext *f)
     }
 #endif
 
-static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w,
+static inline void mcdc(uint16_t *dst, const uint16_t *src, int log2w,
                         int h, int stride, int scale, unsigned dc)
 {
     int i;
@@ -578,7 +578,7 @@ static int decode_i_mb(FourXContext *f)
 static const uint8_t *read_huffman_tables(FourXContext *f,
                                           const uint8_t * const buf, int buf_size)
 {
-    int frequency[512];
+    int frequency[512] = { 0 };
     uint8_t flag[512];
     int up[512];
     uint8_t len_tab[257];
@@ -588,7 +588,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
     const uint8_t *ptr_end = buf + buf_size;
     int j;
 
-    memset(frequency, 0, sizeof(frequency));
     memset(up, -1, sizeof(up));
 
     start = *ptr++;
@@ -691,10 +690,9 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
 
     for (y = 0; y < height; y += 16) {
         for (x = 0; x < width; x += 16) {
-            unsigned int color[4], bits;
+            unsigned int color[4] = { 0 }, bits;
             if (buf_end - buf < 8)
                 return -1;
-            memset(color, 0, sizeof(color));
             // warning following is purely guessed ...
             color[0] = bytestream2_get_le16u(&g3);
             color[1] = bytestream2_get_le16u(&g3);
@@ -925,7 +923,7 @@ static av_cold void common_init(AVCodecContext *avctx)
 {
     FourXContext * const f = avctx->priv_data;
 
-    dsputil_init(&f->dsp, avctx);
+    ff_dsputil_init(&f->dsp, avctx);
 
     f->avctx = avctx;
 }
@@ -969,7 +967,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
         av_freep(&f->cfrm[i].data);
         f->cfrm[i].allocated_size = 0;
     }
-    free_vlc(&f->pre_vlc);
+    ff_free_vlc(&f->pre_vlc);
     if (f->current_picture.data[0])
         avctx->release_buffer(avctx, &f->current_picture);
     if (f->last_picture.data[0])