-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seek(SeekMode::Accurate, x)
can jump onto a position that is after the requested seek position
#261
Comments
By the way I had |
Actually, even with |
After reading the flac demuxer, it turns out that it currently ignores both gapless and the seek mode. |
This loop seems suspicious to me, it seems that the loop can only forward. Maybe I don't understand correctly what those function do. |
I've opened #262 |
Maybe this is what happens:
I believe the linear search doesn't work, maybe when it is at the edge? |
By the way I could run |
Thanks for this. I think your PR and solution makes sense. I'll give it some testing on my end. The goal of the binary search is to find the FLAC frame that contains the sample with the desired timestamp. The timestamp of the FLAC frame is the timestamp of the first sample in that frame. So it would make sense to use
FLAC is naturally gapless and contains enough timing information to implement a cheap accurate seek, so these two options are not relevant to FLAC! |
The PR isn't enough to fix the issue.
I'd suggest that symphonia does something similar in order to honnor the interface contract.
|
Could you provide a test vector that reproduces your problem? Asserting is not an acceptable solution since that will panic the end-user application. It is very conceivable that a broken (e.g., a file with missing FLAC frames), or malicious file could trigger a failure. A fix should be implemented for well-formed files, but for other cases I think the behaviour is acceptable. |
@pdeljanov yes, I can share one file with a seek offset, but not publicly as it isn't free music. How to send it to you? |
@abique Thanks. You can send it to philip (dot) deljanov (at) gmail (dot) com. |
@pdeljanov sent. |
Thanks! Fixed! |
Hi,
I've written some fuzzing tests with symphonia and the following assertion fails:
Here is what the debugger shows:
According to the documentation we could always assert that
assert!(actual_ts < required_ts);
:This happened on a FLAC file.
Cheers,
Alex
The text was updated successfully, but these errors were encountered: