mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
PulseAudio: Fix a possible division by zero.
This commit is contained in:
+2
-1
@@ -23465,7 +23465,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
|
|||||||
attr = *pActualAttr;
|
attr = *pActualAttr;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDescriptorPlayback->periodCount = attr.maxlength / attr.tlength;
|
pDescriptorPlayback->periodCount = ma_max(attr.maxlength / attr.tlength, 1);
|
||||||
pDescriptorPlayback->periodSizeInFrames = attr.maxlength / ma_get_bytes_per_frame(pDescriptorPlayback->format, pDescriptorPlayback->channels) / pDescriptorPlayback->periodCount;
|
pDescriptorPlayback->periodSizeInFrames = attr.maxlength / ma_get_bytes_per_frame(pDescriptorPlayback->format, pDescriptorPlayback->channels) / pDescriptorPlayback->periodCount;
|
||||||
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[PulseAudio] Playback actual attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; internalPeriodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDescriptorPlayback->periodSizeInFrames);
|
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[PulseAudio] Playback actual attr: maxlength=%d, tlength=%d, prebuf=%d, minreq=%d, fragsize=%d; internalPeriodSizeInFrames=%d\n", attr.maxlength, attr.tlength, attr.prebuf, attr.minreq, attr.fragsize, pDescriptorPlayback->periodSizeInFrames);
|
||||||
|
|
||||||
@@ -69443,6 +69443,7 @@ REVISION HISTORY
|
|||||||
v0.10.43 - TBD
|
v0.10.43 - TBD
|
||||||
- ALSA: Fix use of uninitialized variables
|
- ALSA: Fix use of uninitialized variables
|
||||||
- ALSA: Fix enumeration of devices that support both playback and capture.
|
- ALSA: Fix enumeration of devices that support both playback and capture.
|
||||||
|
- PulseAudio: Fix a possible division by zero.
|
||||||
- WebAudio: Fix errors in strict mode.
|
- WebAudio: Fix errors in strict mode.
|
||||||
|
|
||||||
v0.10.42 - 2021-08-22
|
v0.10.42 - 2021-08-22
|
||||||
|
|||||||
Reference in New Issue
Block a user