Skip to content
Snippets Groups Projects
Commit f4c72321 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

Fix crash in seeking_example.

When a match fails, the index of the position in the link needs to
 be 64 bits.
parent 78e5fffc
No related branches found
No related tags found
No related merge requests found
......@@ -164,15 +164,15 @@ static void verify_seek(OggOpusFile *_of,opus_int64 _byte_offset,
if(_bigassbuffer!=NULL){
for(i=0;i<nsamples*nchannels;i++){
if(!MATCH(buffer[i],_bigassbuffer[pcm_offset*nchannels+i])){
ogg_int64_t j;
fprintf(stderr,"\nData after seek doesn't match declared PCM "
"position: mismatch %G\n",
(double)buffer[i]-_bigassbuffer[pcm_offset*nchannels+i]);
for(i=0;i<duration-nsamples;i++){
int j;
for(j=0;j<nsamples*nchannels;j++){
if(!MATCH(buffer[j],_bigassbuffer[i*nchannels+j]))break;
for(j=0;j<duration-nsamples;j++){
for(i=0;i<nsamples*nchannels;i++){
if(!MATCH(buffer[i],_bigassbuffer[j*nchannels+i]))break;
}
if(j==nsamples*nchannels){
if(i==nsamples*nchannels){
fprintf(stderr,"\nData after seek appears to match position %li.\n",
(long)i);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment