[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 6/6] audio: fix integer overflow
From: |
Gerd Hoffmann |
Subject: |
[PULL 6/6] audio: fix integer overflow |
Date: |
Mon, 6 Jan 2020 13:52:36 +0100 |
From: Volker RĂ¼melin <address@hidden>
Tell the compiler to do a 32bit * 32bit -> 64bit multiplication
because period_ticks is a 64bit variable. The overflow occurs
for audio timer periods larger than 4294967us.
Fixes: be1092afa0 "audio: fix audio timer rate conversion bug"
Signed-off-by: Volker RĂ¼melin <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
audio/audio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/audio/audio.c b/audio/audio.c
index 56fae5504710..abea027fdf69 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1738,7 +1738,7 @@ static AudioState *audio_init(Audiodev *dev, const char
*name)
if (dev->timer_period <= 0) {
s->period_ticks = 1;
} else {
- s->period_ticks = dev->timer_period * SCALE_US;
+ s->period_ticks = dev->timer_period * (int64_t)SCALE_US;
}
e = qemu_add_vm_change_state_handler (audio_vm_change_state_handler, s);
--
2.18.1
- [PULL 0/6] Audio 20200106 patches, Gerd Hoffmann, 2020/01/06
- [PULL 2/6] hda-codec: fix recording rate control, Gerd Hoffmann, 2020/01/06
- [PULL 4/6] paaudio: try to drain the recording stream, Gerd Hoffmann, 2020/01/06
- [PULL 1/6] hda-codec: fix playback rate control, Gerd Hoffmann, 2020/01/06
- [PULL 5/6] paaudio: wait until the recording stream is ready, Gerd Hoffmann, 2020/01/06
- [PULL 6/6] audio: fix integer overflow,
Gerd Hoffmann <=
- [PULL 3/6] paaudio: drop recording stream in qpa_fini_in, Gerd Hoffmann, 2020/01/06
- Re: [PULL 0/6] Audio 20200106 patches, Peter Maydell, 2020/01/06