changeset 2426:1ee03f2a6cd5 libavcodec

av_malloc vs av_mallocz patch by (Kurosu <kurosu inforezo org>)
author michael
date Wed, 12 Jan 2005 18:25:48 +0000
parents d0bcc85d3856
children d1b1a6258930
files asv1.c mpegvideo.c resample2.c utils.c
diffstat 4 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/asv1.c	Wed Jan 12 11:14:12 2005 +0000
+++ b/asv1.c	Wed Jan 12 18:25:48 2005 +0000
@@ -579,7 +579,7 @@
     }
 
     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);
 
--- a/mpegvideo.c	Wed Jan 12 11:14:12 2005 +0000
+++ b/mpegvideo.c	Wed Jan 12 18:25:48 2005 +0000
@@ -594,7 +594,6 @@
         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++){
--- a/resample2.c	Wed Jan 12 11:14:12 2005 +0000
+++ b/resample2.c	Wed Jan 12 18:25:48 2005 +0000
@@ -135,8 +135,6 @@
     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;
--- a/utils.c	Wed Jan 12 11:14:12 2005 +0000
+++ b/utils.c	Wed Jan 12 18:25:48 2005 +0000
@@ -314,7 +314,7 @@
             //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);