Commit b7d73020 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry

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.


git-svn-id: https://svn.xiph.org/trunk/Tremor@18116 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent c7b26d13
......@@ -181,7 +181,7 @@ static ogg_int64_t _get_prev_page(OggVorbis_File *vf,ogg_page *og){
}
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 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
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 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
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 @@ int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
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++)
......
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