[xiph-commits] r18116 - trunk/Tremor

tterribe at svn.xiph.org tterribe at svn.xiph.org
Sun Nov 6 06:36:14 PST 2011


Author: tterribe
Date: 2011-11-06 06:36:14 -0800 (Sun, 06 Nov 2011)
New Revision: 18116

Modified:
   trunk/Tremor/vorbisfile.c
Log:
Fix mis-matched types for serialno's.

The use of long caused some functions which now use libogg's
 ogg_page_serialno() (which returns an int) to sign-extend the
 serialno, while the actual list was stored as ogg_uint32_t's.
This would cause subsequent lookups to fail on platforms with a
 64-bit long.
Introduced in r17375 and r16259, but only partially corrected in
 r17536.
Fixes #1838.
Thanks to achurch for the report.


Modified: trunk/Tremor/vorbisfile.c
===================================================================
--- trunk/Tremor/vorbisfile.c	2011-11-04 23:55:47 UTC (rev 18115)
+++ trunk/Tremor/vorbisfile.c	2011-11-06 14:36:14 UTC (rev 18116)
@@ -181,7 +181,7 @@
 }
 
 static void _add_serialno(ogg_page *og,ogg_uint32_t **serialno_list, int *n){
-  long s = ogg_page_serialno(og);
+  ogg_uint32_t s = ogg_page_serialno(og);
   (*n)++;
 
   if(*serialno_list){
@@ -820,7 +820,7 @@
 
       if(vf->ready_state<STREAMSET){
         if(vf->seekable){
-          long serialno = ogg_page_serialno(&og);
+          ogg_uint32_t serialno = ogg_page_serialno(&og);
 
           /* match the serialno to bitstream section.  We use this rather than
              offset positions to avoid problems near logical bitstream
@@ -1315,7 +1315,7 @@
 
       if(vf->ready_state<STREAMSET){
         int link;
-        long serialno = ogg_page_serialno(&og);
+        ogg_uint32_t serialno = ogg_page_serialno(&og);
 
         for(link=0;link<vf->links;link++)
           if(vf->serialnos[link]==serialno)break;
@@ -1627,7 +1627,7 @@
       if(ogg_page_bos(&og))_decode_clear(vf);
 
       if(vf->ready_state<STREAMSET){
-        long serialno=ogg_page_serialno(&og);
+        ogg_uint32_t serialno=ogg_page_serialno(&og);
         int link;
 
         for(link=0;link<vf->links;link++)



More information about the commits mailing list