Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix potential infinite loop in mix_source_buffer() in case of uneven input buffer#31

Merged
icculus merged 1 commit intoicculus:mainfrom
ivan-mogilko:fix--mixerinfiniteloop
Jan 11, 2025
Merged

Fix potential infinite loop in mix_source_buffer() in case of uneven input buffer#31
icculus merged 1 commit intoicculus:mainfrom
ivan-mogilko:fix--mixerinfiniteloop

Conversation

@ivan-mogilko
Copy link
Contributor

@ivan-mogilko ivan-mogilko commented Jan 11, 2025

Fix #23

This is a hotfix that we've been using in our game engine for a while now, it covers a rare situation with badly formed input buffer, which I've described in the issue #23.

This fixes a potential infinite loop, which may occur in two cases:

  1. If remaining data in the input is less than bufferframesize, in such case bytesput resulted in 0, and src->offset never advanced.
  2. If remaining data's size is not evenly divided by sizeof(float), the data pointer again will not advance to the end.

This fixes a potential infinite loop, which may occur in two cases:
1. If remaining data in the input is less than `bufferframesize`, in such case `bytesput` resulted in 0, and src->offset never advanced.
2. If remaining data's size is not evenly divided by sizeof(float), the data pointer again will not advance to the end.
@ivan-mogilko ivan-mogilko force-pushed the fix--mixerinfiniteloop branch from 51aa56c to afb81c3 Compare January 11, 2025 15:09
@icculus icculus merged commit aeaeff2 into icculus:main Jan 11, 2025
3 checks passed
@ivan-mogilko ivan-mogilko deleted the fix--mixerinfiniteloop branch January 11, 2025 23:42
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 infinite loop in sound mixer

2 participants