Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37046120
en ru br
Репозитории ALT

Группа :: Графические оболочки/Прочее
Пакет: SPICE

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: 0001-sound-Fix-pointer-arithmetic-in-snd_record_handle_write.patch
Скачать


From a5d1d957d6c16e3fe213e10d0cab4bfe2504ba91 Mon Sep 17 00:00:00 2001
From: Volker Rц╪melin <vr_qemu@t-online.de>
Date: Sat, 22 Oct 2022 13:51:15 +0200
Subject: [PATCH] sound: Fix pointer arithmetic in snd_record_handle_write()
The variable 'now' counts in audio sample frames, but the variable
'data' is of type uint8_t *. Multiply 'now' by the size of an audio
sample frame to get the correct source pointer.
This improves the quality of audio recordings in QEMU a little bit.
Fixes: 5d5a7bd181 ("sound: Avoid cast that could cause alignment problems")
Signed-off-by: Volker Rц╪melin <vr_qemu@t-online.de>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
---
 server/sound.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/sound.cpp b/server/sound.cpp
index eca2706..4909d15 100644
--- a/server/sound.cpp
+++ b/server/sound.cpp
@@ -302,7 +302,7 @@ static bool snd_record_handle_write(RecordChannelClient *record_client, size_t s
     memcpy(record_client->samples + write_pos, data, now << 2);
 
     if (size) {
-        memcpy(record_client->samples, data + now, size << 2);
+        memcpy(record_client->samples, data + (now << 2), size << 2);
     }
 
     if (record_client->write_pos - record_client->read_pos > RECORD_SAMPLES_SIZE) {
--
libgit2 1.3.2
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin