[xiph-commits] r14539 - trunk/vorbis-tools/ogginfo

ivo at svn.xiph.org ivo at svn.xiph.org
Sat Feb 23 14:18:16 PST 2008


Author: ivo
Date: 2008-02-23 14:18:15 -0800 (Sat, 23 Feb 2008)
New Revision: 14539

Modified:
   trunk/vorbis-tools/ogginfo/theora.c
Log:
Fix potential problem where int and long might be mixed unnecessarily.

Modified: trunk/vorbis-tools/ogginfo/theora.c
===================================================================
--- trunk/vorbis-tools/ogginfo/theora.c	2008-02-22 21:16:12 UTC (rev 14538)
+++ trunk/vorbis-tools/ogginfo/theora.c	2008-02-23 22:18:15 UTC (rev 14539)
@@ -117,9 +117,9 @@
 
 static int _theora_unpack_comment(theora_comment *tc, oggpack_buffer *opb){
   int i;
-  int len;
+  long len;
 
-   _tp_readlsbint(opb,(long *) &len);
+  _tp_readlsbint(opb,&len);
   if(len<0)return(OC_BADHEADER);
   tc->vendor=_ogg_calloc(1,len+1);
   _tp_readbuffer(opb,tc->vendor, len);
@@ -130,7 +130,7 @@
   tc->user_comments=_ogg_calloc(tc->comments,sizeof(*tc->user_comments));
   tc->comment_lengths=_ogg_calloc(tc->comments,sizeof(*tc->comment_lengths));
   for(i=0;i<tc->comments;i++){
-    _tp_readlsbint(opb,(long *)&len);
+    _tp_readlsbint(opb,&len);
     if(len<0)goto parse_err;
     tc->user_comments[i]=_ogg_calloc(1,len+1);
     _tp_readbuffer(opb,tc->user_comments[i],len);
@@ -152,15 +152,15 @@
 int theora_decode_header(theora_info *ci, theora_comment *cc, ogg_packet *op){
   long ret;
   oggpack_buffer *opb;
-  
+
   if(!op)return OC_BADHEADER;
-  
+
   opb = _ogg_malloc(sizeof(oggpack_buffer));
   oggpackB_readinit(opb,op->packet,op->bytes);
   {
     char id[6];
     int typeflag;
-    
+
     theora_read(opb,8,&ret);
     typeflag = ret;
     if(!(typeflag&0x80)) {
@@ -212,7 +212,7 @@
       ret = _theora_unpack_tables(ci,opb);
       free(opb);
       return(ret);
-    
+
     default:
       free(opb);
       /* ignore any trailing header packets for forward compatibility */
@@ -223,4 +223,3 @@
   free(opb);
   return(OC_BADHEADER);
 }
-



More information about the commits mailing list