1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

av_malloc vs av_mallocz patch by (Kurosu <kurosu inforezo org>)

Originally committed as revision 3830 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Kurosu 2005-01-12 18:25:48 +00:00 committed by Michael Niedermayer
parent 83b074704b
commit f41c1fac3c
4 changed files with 2 additions and 5 deletions

View File

@ -579,7 +579,7 @@ static int decode_init(AVCodecContext *avctx){
}
p->qstride= a->mb_width;
p->qscale_table= av_mallocz( p->qstride * a->mb_height);
p->qscale_table= av_malloc( p->qstride * a->mb_height);
p->quality= (32*scale + a->inv_qscale/2)/a->inv_qscale;
memset(p->qscale_table, p->quality, p->qstride*a->mb_height);

View File

@ -594,7 +594,6 @@ static void MPV_encode_defaults(MpegEncContext *s){
done=1;
default_mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
memset(default_mv_penalty, 0, sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1));
memset(default_fcode_tab , 0, sizeof(uint8_t)*(2*MAX_MV+1));
for(i=-16; i<16; i++){

View File

@ -135,8 +135,6 @@ AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size,
double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
int phase_count= 1<<phase_shift;
memset(c, 0, sizeof(AVResampleContext));
c->phase_shift= phase_shift;
c->phase_mask= phase_count-1;
c->linear= linear;

View File

@ -314,7 +314,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
//FIXME next ensures that linesize= 2^x uvlinesize, thats needed because some MC code assumes it
buf->linesize[i]= ALIGN(pixel_size*w>>h_shift, STRIDE_ALIGN<<(h_chroma_shift-h_shift));
buf->base[i]= av_mallocz((buf->linesize[i]*h>>v_shift)+16); //FIXME 16
buf->base[i]= av_malloc((buf->linesize[i]*h>>v_shift)+16); //FIXME 16
if(buf->base[i]==NULL) return -1;
memset(buf->base[i], 128, buf->linesize[i]*h>>v_shift);