Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
a06ca7ee
Commit
a06ca7ee
authored
Mar 04, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent a division by zero.
parent
f8dd3780
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
miniaudio.h
miniaudio.h
+13
-1
No files found.
miniaudio.h
View file @
a06ca7ee
...
...
@@ -33543,11 +33543,21 @@ MA_API ma_uint32 ma_scale_buffer_size(ma_uint32 baseBufferSize, float scale)
MA_API ma_uint32 ma_calculate_buffer_size_in_milliseconds_from_frames(ma_uint32 bufferSizeInFrames, ma_uint32 sampleRate)
{
/* Prevent a division by zero. */
if (sampleRate == 0) {
return 0;
}
return bufferSizeInFrames / (sampleRate/1000);
}
MA_API ma_uint32 ma_calculate_buffer_size_in_frames_from_milliseconds(ma_uint32 bufferSizeInMilliseconds, ma_uint32 sampleRate)
{
/* Prevent a division by zero. */
if (sampleRate == 0) {
return 0;
}
return bufferSizeInMilliseconds * (sampleRate/1000);
}
...
...
@@ -64471,7 +64481,9 @@ The following miscellaneous changes have also been made.
REVISION HISTORY
================
v0.10.33 - TBD
-
- Add a safety check to the following APIs to prevent a division by zero:
- ma_calculate_buffer_size_in_milliseconds_from_frames()
- ma_calculate_buffer_size_in_milliseconds_from_milliseconds()
v0.10.32 - 2021-02-23
- WASAPI: Fix a deadlock in exclusive mode.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment