Skip to content
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

Assertion failure loading missing sample in MSVC debug build #5213

Closed
DomClark opened this issue Oct 1, 2019 · 1 comment · Fixed by #5816
Closed

Assertion failure loading missing sample in MSVC debug build #5213

DomClark opened this issue Oct 1, 2019 · 1 comment · Fixed by #5816

Comments

@DomClark
Copy link
Member

DomClark commented Oct 1, 2019

When loading a sample from a file, the file descriptor is passed to sf_open_fd without checking whether the file was opened successfully. On Windows, sf_open_fd then passes the file descriptor to _get_osfhandle to get the native file handle for the file descriptor. However, _get_osfhandle has an assertion to check the validity of the provided file descriptor, which is active in debug versions of the CRT (only used by MSVC debug builds, AFAIK) and is triggered when, for example, the sample doesn't exist. To avoid this, I think we should check that QFile::open returns true before calling sf_open_fd.

@Reflexe It looks like, as part of the recording work, you're refactoring SampleBuffer, which is where this function is used. Could you take care of this while you're at it?

@PhysSong
Copy link
Member

PhysSong commented Oct 1, 2019

As the author of #4401 which introduced those changes, I should have added more checks before merging.
BTW, any commits which change the SampleBuffer code are very likely to conflict with the recording PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants