[xiph-cvs] cvs commit: vorbis/lib bitrate.c vorbisenc.c

Monty xiphmont at xiph.org
Mon Jan 21 18:19:10 PST 2002



xiphmont    02/01/21 18:19:10

  Modified:    lib      bitrate.c vorbisenc.c
  Log:
  Some memory allocations missing the _ogg_ prefix

Revision  Changes    Path
1.10      +5 -5      vorbis/lib/bitrate.c

Index: bitrate.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/bitrate.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- bitrate.c	2001/12/23 11:54:49	1.9
+++ bitrate.c	2002/01/22 02:19:09	1.10
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: bitrate tracking and management
- last mod: $Id: bitrate.c,v 1.9 2001/12/23 11:54:49 xiphmont Exp $
+ last mod: $Id: bitrate.c,v 1.10 2002/01/22 02:19:09 xiphmont Exp $
 
  ********************************************************************/
 
@@ -154,14 +154,14 @@
       }
       
       /* space for the packet queueing */
-      bm->queue_packet_buffers=calloc(maxpackets,sizeof(*bm->queue_packet_buffers));
-      bm->queue_packets=calloc(maxpackets,sizeof(*bm->queue_packets));
+      bm->queue_packet_buffers=_ogg_calloc(maxpackets,sizeof(*bm->queue_packet_buffers));
+      bm->queue_packets=_ogg_calloc(maxpackets,sizeof(*bm->queue_packets));
       for(i=0;i<maxpackets;i++)
         oggpack_writeinit(bm->queue_packet_buffers+i);
       
     }else{
-      bm->queue_packet_buffers=calloc(1,sizeof(*bm->queue_packet_buffers));
-      bm->queue_packets=calloc(1,sizeof(*bm->queue_packets));
+      bm->queue_packet_buffers=_ogg_calloc(1,sizeof(*bm->queue_packet_buffers));
+      bm->queue_packets=_ogg_calloc(1,sizeof(*bm->queue_packets));
       oggpack_writeinit(bm->queue_packet_buffers);
     }      
   }

<p><p>1.35      +8 -8      vorbis/lib/vorbisenc.c

Index: vorbisenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisenc.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- vorbisenc.c	2002/01/22 02:16:40	1.34
+++ vorbisenc.c	2002/01/22 02:19:09	1.35
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: simple programmatic interface for encoder mode setup
- last mod: $Id: vorbisenc.c,v 1.34 2002/01/22 02:16:40 xiphmont Exp $
+ last mod: $Id: vorbisenc.c,v 1.35 2002/01/22 02:19:09 xiphmont Exp $
 
  ********************************************************************/
 
@@ -78,25 +78,25 @@
     /* time mapping hooks are unused in vorbis I */
     ci->times=1;
     ci->time_type[0]=0;
-    ci->time_param[0]=calloc(1,sizeof(_time_dummy));
+    ci->time_param[0]=_ogg_calloc(1,sizeof(_time_dummy));
     memcpy(ci->time_param[0],&_time_dummy,sizeof(_time_dummy));
 
     /* by convention, two modes: one for short, one for long blocks.
        short block mode uses mapping sero, long block uses mapping 1 */
     ci->modes=2;
-    ci->mode_param[0]=calloc(1,sizeof(_mode_set_short));
+    ci->mode_param[0]=_ogg_calloc(1,sizeof(_mode_set_short));
     memcpy(ci->mode_param[0],&_mode_set_short,sizeof(_mode_set_short));
-    ci->mode_param[1]=calloc(1,sizeof(_mode_set_long));
+    ci->mode_param[1]=_ogg_calloc(1,sizeof(_mode_set_long));
     memcpy(ci->mode_param[1],&_mode_set_long,sizeof(_mode_set_long));
 
     /* by convention two mappings, both mapping type zero (polyphonic
        PCM), first for short, second for long blocks */
     ci->maps=2;
     ci->map_type[0]=0;
-    ci->map_param[0]=calloc(1,sizeof(_mapping_set_short));
+    ci->map_param[0]=_ogg_calloc(1,sizeof(_mapping_set_short));
     memcpy(ci->map_param[0],&_mapping_set_short,sizeof(_mapping_set_short));
     ci->map_type[1]=0;
-    ci->map_param[1]=calloc(1,sizeof(_mapping_set_long));
+    ci->map_param[1]=_ogg_calloc(1,sizeof(_mapping_set_long));
     memcpy(ci->map_param[1],&_mapping_set_long,sizeof(_mapping_set_long));
 
     return(0);
@@ -109,7 +109,7 @@
                                     vorbis_info_floor1 *in, 
                                     ...){
   int x[11],i,k,iq=rint(q*10);
-  vorbis_info_floor1 *f=calloc(1,sizeof(*f));
+  vorbis_info_floor1 *f=_ogg_calloc(1,sizeof(*f));
   codec_setup_info *ci=vi->codec_setup;
   va_list ap;
 
@@ -196,7 +196,7 @@
   if(block>=ci->psys)
     ci->psys=block+1;
   if(!p){
-    p=calloc(1,sizeof(*p));
+    p=_ogg_calloc(1,sizeof(*p));
     ci->psy_param[block]=p;
   }
 
@@ -407,7 +407,7 @@
     /* free preexisting instance */
     residue_free_info(ci->residue_param[block],ci->residue_type[block]);
 
-  r=ci->residue_param[block]=malloc(sizeof(*r));
+  r=ci->residue_param[block]=_ogg_malloc(sizeof(*r));
   memcpy(r,in[iq].res[block],sizeof(*r));
   if(ci->residues<=block)ci->residues=block+1;
 

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list