8000 Fix logic error in loop boundary check by SmithGoll · Pull Request #42 · pedrolcl/sonivox · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix logic error in loop boundary check #42

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

Merged
merged 1 commit into from
Mar 30, 2025
Merged

Conversation

SmithGoll
Copy link

Description

In eas_mdls.c, there exists some conditional check that may cause unintended behavior:

(pWsmp->loopStart + pWsmp->loopLength) * sizeof(EAS_SAMPLE) > sampleLen - sizeof(EAS_SAMPLE)

When the following equality occurs:

(pWsmp->loopStart + pWsmp->loopLength) * sizeof(EAS_SAMPLE) == sampleLen

It results in failed file loading for DLS sound banks (test case: Saga_2_Soundfont___Midi.rar).

The correct approach should be as follows

(pWsmp->loopStart + pWsmp->loopLength) * sizeof(EAS_SAMPLE) > sampleLen

Related Issues

Potential Logic Error in Loop Boundary Check Causes DLS File Load Failure #41

Checklist

  • I have followed the contribution guidelines.
  • My code follows the coding standards.
  • I have tested my changes.

Copy link
Owner
@pedrolcl pedrolcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pedrolcl pedrolcl merged commit d3d692f into pedrolcl:devel Mar 30, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential Logic Error in Loop Boundary Check Causes DLS File Load Failure
2 participants
0