1
0
mirror of https://gitlab.com/qemu-project/qemu synced 2024-07-09 04:27:12 +00:00
qemu/audio
Volker Rümelin b6d93282cc audio: prevent an integer overflow in resampling code
There are corner cases where rate->opos can overflow. For
example, if QEMU is started with -audiodev pa,id=audio0,
out.frequency=11025 -device ich9-intel-hda -device hda-duplex,
audiodev=audio0 and the guest plays audio with a sampling
frequency of 44100Hz, rate->opos will overflow after 27.05h
and the audio stream will be silent for a long time.

To prevent a rate->opos and also a rate->ipos overflow, both
are wrapped around after a short time. The wrap around point
rate->ipos >= 0x10001 is an arbitrarily selected value and can
be any small value, 0 and 1 included.

The comment that an ipos overflow will result in an infinite
loop has been removed, because in this case the resampling code
only generates no more output samples and the audio stream stalls.
However, there is no infinite loop.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20220923183640.8314-12-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-10-11 10:17:08 +02:00
..
alsaaudio.c alsaaudio: reduce playback latency 2022-10-11 10:17:08 +02:00
audio_int.h audio: swap audio_rate_get_bytes() function parameters 2022-10-11 10:17:08 +02:00
audio_legacy.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
audio_template.h audio: fix sw->buf size for audio recording 2022-10-11 10:17:08 +02:00
audio_win_int.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
audio_win_int.h Windows Waveform Audio driver (no ADC support yet) 2009-10-10 01:18:24 +04:00
audio.c audio: fix sw->buf size for audio recording 2022-10-11 10:17:08 +02:00
audio.h audio: add help option for -audio and -audiodev 2022-09-19 15:15:59 +02:00
coreaudio.m Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
dbusaudio.c audio: swap audio_rate_get_bytes() function parameters 2022-10-11 10:17:08 +02:00
dsound_template.h dsoundaudio: replace GetForegroundWindow() 2021-01-15 11:25:22 +01:00
dsoundaudio.c Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
jackaudio.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
meson.build audio: Add sndio backend 2022-09-27 07:32:31 +02:00
mixeng_template.h audio: fix saturation nonlinearity in clip_* functions 2020-03-16 10:18:07 +01:00
mixeng.c audio/mixeng: Do not declare unused variables 2022-03-18 09:32:48 +01:00
mixeng.h audio: proper support for float samples in mixeng 2020-02-06 14:35:57 +01:00
noaudio.c audio: swap audio_rate_get_bytes() function parameters 2022-10-11 10:17:08 +02:00
ossaudio.c Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
paaudio.c Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
rate_template.h audio: prevent an integer overflow in resampling code 2022-10-11 10:17:08 +02:00
sdlaudio.c Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
sndioaudio.c audio: Add sndio backend 2022-09-27 07:32:31 +02:00
spiceaudio.c audio: swap audio_rate_get_bytes() function parameters 2022-10-11 10:17:08 +02:00
trace-events audio: add "dbus" audio backend 2021-12-21 10:50:22 +04:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
wavaudio.c audio: swap audio_rate_get_bytes() function parameters 2022-10-11 10:17:08 +02:00
wavcapture.c monitor: Use getter/setter functions for cur_mon 2020-10-09 07:08:19 +02:00