X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fsnowenc.c;h=5067a363ceb7a48fc58a5a0486614294c89d195d;hb=9340ced47b5b13991619d56c2be86a6604e63f5b;hp=996ab6b95a7e9a3e5407ac31d6d4ba492cad03f7;hpb=443261cbbdaac2eaba5fada318fa596bd5ab3e4a;p=ffmpeg diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 996ab6b95a7..5067a363ceb 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -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; imax_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;