You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcdoec/snowenc: use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -72,7 +72,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
|||||||
s->m.bit_rate= avctx->bit_rate;
|
s->m.bit_rate= avctx->bit_rate;
|
||||||
|
|
||||||
s->m.me.temp =
|
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.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
|
||||||
s->m.me.score_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));
|
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 i;
|
||||||
int size= s->b_width * s->b_height << 2*s->block_max_depth;
|
int size= s->b_width * s->b_height << 2*s->block_max_depth;
|
||||||
for(i=0; i<s->max_ref_frames; i++){
|
for(i=0; i<s->max_ref_frames; i++){
|
||||||
s->ref_mvs[i]= av_mallocz(size*sizeof(int16_t[2]));
|
s->ref_mvs[i]= av_mallocz_array(size, sizeof(int16_t[2]));
|
||||||
s->ref_scores[i]= av_mallocz(size*sizeof(uint32_t));
|
s->ref_scores[i]= av_mallocz_array(size, sizeof(uint32_t));
|
||||||
if (!s->ref_mvs[i] || !s->ref_scores[i])
|
if (!s->ref_mvs[i] || !s->ref_scores[i])
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user