]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/snowenc.c
Merge remote-tracking branch 'cehoyos/master'
[ffmpeg] / libavcodec / snowenc.c
index 996ab6b95a7e9a3e5407ac31d6d4ba492cad03f7..5067a363ceb7a48fc58a5a0486614294c89d195d 100644 (file)
@@ -72,7 +72,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
     s->m.bit_rate= avctx->bit_rate;
 
     s->m.me.temp      =
-    s->m.me.scratchpad= av_mallocz((avctx->width+64)*2*16*2*sizeof(uint8_t));
+    s->m.me.scratchpad= av_mallocz_array((avctx->width+64), 2*16*2*sizeof(uint8_t));
     s->m.me.map       = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
     s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
     s->m.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t));
@@ -131,8 +131,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
         int i;
         int size= s->b_width * s->b_height << 2*s->block_max_depth;
         for(i=0; i<s->max_ref_frames; i++){
-            s->ref_mvs[i]= av_mallocz(size*sizeof(int16_t[2]));
-            s->ref_scores[i]= av_mallocz(size*sizeof(uint32_t));
+            s->ref_mvs[i]= av_mallocz_array(size, sizeof(int16_t[2]));
+            s->ref_scores[i]= av_mallocz_array(size, sizeof(uint32_t));
             if (!s->ref_mvs[i] || !s->ref_scores[i])
                 return AVERROR(ENOMEM);
         }
@@ -1543,7 +1543,7 @@ static void calculate_visual_weight(SnowContext *s, Plane *p){
 }
 
 static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
-                        AVFrame *pict, int *got_packet)
+                        const AVFrame *pict, int *got_packet)
 {
     SnowContext *s = avctx->priv_data;
     RangeCoder * const c= &s->c;