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

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

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

Патч: 0010-stream-channel-Fix-compiler-warning.patch
Скачать


From c5412b071a971dd7a93f5b0d01aa801efc31490f Mon Sep 17 00:00:00 2001
From: Frediano Ziglio <freddy77@gmail.com>
Date: Sun, 9 May 2021 06:33:43 +0100
Subject: [PATCH] stream-channel: Fix compiler warning
This removes:
In function Б─≤stream_channel_get_supported_codecsБ─≥,
    inlined from Б─≤on_connectБ─≥ at ../server/stream-channel.cpp:364:60:
../server/stream-channel.cpp:326:31: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  326 |             out_codecs[num++] = codec;
      |                               ^
../server/stream-channel.cpp: In member function Б─≤on_connectБ─≥:
/usr/include/spice-1/spice/stream-device.h:209:13: note: destination object Б─≤codecsБ─≥ of size 0
  209 |     uint8_t codecs[0];
      |             ^
Reported by by Tomasz Kе┌oczko in
https://gitlab.freedesktop.org/spice/spice/-/issues/44
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
---
 server/stream-channel.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/server/stream-channel.cpp b/server/stream-channel.cpp
index c3e09ca..4d531eb 100644
--- a/server/stream-channel.cpp
+++ b/server/stream-channel.cpp
@@ -351,6 +351,9 @@ void StreamChannel::on_connect(RedClient *red_client, RedStream *stream,
         StreamMsgStartStop base;
         uint8_t codecs_buffer[MAX_SUPPORTED_CODECS];
     } start_msg;
+    static_assert(offsetof(StreamMsgStartStop, codecs) ==
+                  offsetof(decltype(start_msg), codecs_buffer),
+                  "Wrong assumption");
     StreamMsgStartStop *const start = &start_msg.base;
 
     spice_return_if_fail(stream != nullptr);
@@ -361,7 +364,7 @@ void StreamChannel::on_connect(RedClient *red_client, RedStream *stream,
     }
 
     // request new stream
-    start->num_codecs = stream_channel_get_supported_codecs(this, start->codecs);
+    start->num_codecs = stream_channel_get_supported_codecs(this, start_msg.codecs_buffer);
     // send in any case, even if list is not changed
     // notify device about changes
     request_new_stream(start);
--
libgit2 1.3.0
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin