Commit f41c1fac authored by Kurosu's avatar Kurosu Committed by Michael Niedermayer
Browse files

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

Originally committed as revision 3830 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 83b07470
...@@ -579,7 +579,7 @@ static int decode_init(AVCodecContext *avctx){ ...@@ -579,7 +579,7 @@ static int decode_init(AVCodecContext *avctx){
} }
p->qstride= a->mb_width; 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; p->quality= (32*scale + a->inv_qscale/2)/a->inv_qscale;
memset(p->qscale_table, p->quality, p->qstride*a->mb_height); memset(p->qscale_table, p->quality, p->qstride*a->mb_height);
......
...@@ -594,7 +594,6 @@ static void MPV_encode_defaults(MpegEncContext *s){ ...@@ -594,7 +594,6 @@ static void MPV_encode_defaults(MpegEncContext *s){
done=1; done=1;
default_mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+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)); memset(default_fcode_tab , 0, sizeof(uint8_t)*(2*MAX_MV+1));
for(i=-16; i<16; i++){ for(i=-16; i<16; i++){
......
...@@ -135,8 +135,6 @@ AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, ...@@ -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); double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
int phase_count= 1<<phase_shift; int phase_count= 1<<phase_shift;
memset(c, 0, sizeof(AVResampleContext));
c->phase_shift= phase_shift; c->phase_shift= phase_shift;
c->phase_mask= phase_count-1; c->phase_mask= phase_count-1;
c->linear= linear; c->linear= linear;
......
...@@ -314,7 +314,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ ...@@ -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 //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->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; if(buf->base[i]==NULL) return -1;
memset(buf->base[i], 128, buf->linesize[i]*h>>v_shift); memset(buf->base[i], 128, buf->linesize[i]*h>>v_shift);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment