4 Commits

10 changed files with 462 additions and 4 deletions

View File

@@ -0,0 +1,143 @@
From 681a273cbba744b65e44d0205bce42f2ca794576 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Noel?= <sebastien@twolife.be>
Date: Tue, 30 Jul 2024 11:29:58 +0200
Subject: [PATCH] Fix build with ffmpeg 7
cherry picked from d0c5b1ae4289c7f3cde3fbc031cb4a3160df05ff
from freerdp3
---
libfreerdp/codec/dsp_ffmpeg.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
Index: freerdp-2.11.7/libfreerdp/codec/dsp_ffmpeg.c
===================================================================
--- freerdp-2.11.7.orig/libfreerdp/codec/dsp_ffmpeg.c
+++ freerdp-2.11.7/libfreerdp/codec/dsp_ffmpeg.c
@@ -225,18 +225,15 @@ static void ffmpeg_close_context(FREERDP
static BOOL ffmpeg_open_context(FREERDP_DSP_CONTEXT* context)
{
int ret;
- int layout;
- const AUDIO_FORMAT* format;
if (!context || context->isOpen)
return FALSE;
- format = &context->format;
+ const AUDIO_FORMAT* format = &context->format;
if (!format)
return FALSE;
- layout = av_get_default_channel_layout(format->nChannels);
context->id = ffmpeg_get_avcodec(format);
if (ffmpeg_codec_is_filtered(context->id, context->encoder))
@@ -270,8 +267,7 @@ static BOOL ffmpeg_open_context(FREERDP_
break;
}
- context->context->channels = format->nChannels;
- context->context->channel_layout = layout;
+ av_channel_layout_default(&context->context->ch_layout, format->nChannels);
context->context->sample_rate = format->nSamplesPerSec;
context->context->block_align = format->nBlockAlign;
context->context->bit_rate = format->nAvgBytesPerSec * 8;
@@ -314,8 +310,7 @@ static BOOL ffmpeg_open_context(FREERDP_
if (!context->rcontext)
goto fail;
- context->frame->channel_layout = layout;
- context->frame->channels = format->nChannels;
+ av_channel_layout_default(&context->frame->ch_layout, format->nChannels);
context->frame->sample_rate = format->nSamplesPerSec;
context->frame->format = AV_SAMPLE_FMT_S16;
@@ -330,13 +325,11 @@ static BOOL ffmpeg_open_context(FREERDP_
context->resampled->sample_rate = format->nSamplesPerSec;
}
- context->resampled->channel_layout = layout;
- context->resampled->channels = format->nChannels;
+ av_channel_layout_default(&context->resampled->ch_layout, format->nChannels);
if (context->context->frame_size > 0)
{
- context->buffered->channel_layout = context->resampled->channel_layout;
- context->buffered->channels = context->resampled->channels;
+ av_channel_layout_copy(&context->buffered->ch_layout, &context->resampled->ch_layout);
context->buffered->format = context->resampled->format;
context->buffered->nb_samples = context->context->frame_size;
@@ -421,7 +414,7 @@ static BOOL ffmpeg_encode_frame(AVCodecC
if (in->format == AV_SAMPLE_FMT_FLTP)
{
uint8_t** pp = in->extended_data;
- for (int y = 0; y < in->channels; y++)
+ for (int y = 0; y < in->ch_layout.nb_channels; y++)
{
float* data = (float*)pp[y];
for (int x = 0; x < in->nb_samples; x++)
@@ -477,14 +470,13 @@ static BOOL ffmpeg_fill_frame(AVFrame* f
size_t size)
{
int ret, bpp;
- frame->channels = inputFormat->nChannels;
+ av_channel_layout_default(&frame->ch_layout, inputFormat->nChannels);
frame->sample_rate = inputFormat->nSamplesPerSec;
frame->format = ffmpeg_sample_format(inputFormat);
- frame->channel_layout = av_get_default_channel_layout(frame->channels);
bpp = av_get_bytes_per_sample(frame->format);
frame->nb_samples = size / inputFormat->nChannels / bpp;
- if ((ret = avcodec_fill_audio_frame(frame, frame->channels, frame->format, data, size, 1)) < 0)
+ if ((ret = avcodec_fill_audio_frame(frame, inputFormat->nChannels, frame->format, data, size, 1)) < 0)
{
const char* err = av_err2str(ret);
WLog_ERR(TAG, "Error during audio frame fill %s [%d]", err, ret);
@@ -566,7 +558,7 @@ static BOOL ffmpeg_decode(AVCodecContext
}
{
- const size_t data_size = resampled->channels * resampled->nb_samples * 2;
+ const size_t data_size = resampled->ch_layout.nb_channels * resampled->nb_samples * 2;
Stream_EnsureRemainingCapacity(out, data_size);
Stream_Write(out, resampled->data[0], data_size);
}
@@ -664,7 +656,7 @@ BOOL freerdp_dsp_ffmpeg_encode(FREERDP_D
rc =
av_samples_copy(context->buffered->extended_data, context->resampled->extended_data,
(int)context->bufferedSamples, copied, inSamples,
- context->context->channels, context->context->sample_fmt);
+ context->context->ch_layout.nb_channels, context->context->sample_fmt);
rest -= inSamples;
copied += inSamples;
context->bufferedSamples += (UINT32)inSamples;
Index: freerdp-2.11.7/libfreerdp/codec/h264_ffmpeg.c
===================================================================
--- freerdp-2.11.7.orig/libfreerdp/codec/h264_ffmpeg.c
+++ freerdp-2.11.7/libfreerdp/codec/h264_ffmpeg.c
@@ -100,10 +100,10 @@ static void libavcodec_destroy_encoder(H
if (sys->codecEncoderContext)
{
- avcodec_close(sys->codecEncoderContext);
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 69, 100)
avcodec_free_context(&sys->codecEncoderContext);
#else
+ avcodec_close(sys->codecEncoderContext);
av_free(sys->codecEncoderContext);
#endif
}
@@ -430,10 +430,10 @@ static void libavcodec_uninit(H264_CONTE
if (sys->codecDecoderContext)
{
- avcodec_close(sys->codecDecoderContext);
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 69, 100)
avcodec_free_context(&sys->codecDecoderContext);
#else
+ avcodec_close(sys->codecDecoderContext);
av_free(sys->codecDecoderContext);
#endif
}

View File

@@ -0,0 +1,32 @@
From: Alessandro Bono <alessandro.bono369@gmail.com>
Date: Wed, 8 May 2024 16:06:17 +0200
Subject: info: Fix incompatible pointer type
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This fixes the following:
```
libfreerdp/core/info.c: In function rdp_read_info_null_string:
libfreerdp/core/info.c:88:39: error: initialization of const WCHAR * {aka const short unsigned int *} from incompatible pointer type BYTE * {aka unsigned char *} [-Wincompatible-pointer-types]
88 | const WCHAR* domain = Stream_Pointer(s);
```
(cherry picked from commit 4f411197dc9d2076f00748b1178a60b2423030bf)
---
libfreerdp/core/info.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c
index 9aaa6cf..c9b2fc6 100644
--- a/libfreerdp/core/info.c
+++ b/libfreerdp/core/info.c
@@ -85,7 +85,7 @@ static BOOL rdp_read_info_null_string(const char* what, UINT32 flags, wStream* s
if (cbLen > 0)
{
- const WCHAR* domain = Stream_Pointer(s);
+ const WCHAR* domain = (WCHAR*)Stream_Pointer(s);
if (isNullTerminated && (max > 0))
max -= nullSize;

View File

@@ -0,0 +1,38 @@
From: Alessandro Bono <alessandro.bono369@gmail.com>
Date: Wed, 8 May 2024 16:06:26 +0200
Subject: redirection: Fix incompatible pointer type
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This fixes the following:
```
libfreerdp/core/redirection.c: In function redirection_copy_data:
libfreerdp/core/redirection.c:91:31: error: passing argument 1 of redirection_free_data from incompatible pointer type [-Wincompatible-pointer-types]
91 | redirection_free_data(dst, plen);
| ^~~
| |
| char **
libfreerdp/core/redirection.c:80:42: note: expected BYTE ** {aka unsigned char **} but argument is of type char **
80 | static void redirection_free_data(BYTE** str, UINT32* length)
| ~~~~~~~^~~
```
(cherry picked from commit f3ed1f1ac367eb21f93c9fba5047447fdccdb5cc)
---
libfreerdp/core/redirection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libfreerdp/core/redirection.c b/libfreerdp/core/redirection.c
index 59c6dbc..63bc8cc 100644
--- a/libfreerdp/core/redirection.c
+++ b/libfreerdp/core/redirection.c
@@ -86,7 +86,7 @@ static void redirection_free_data(BYTE** str, UINT32* length)
*str = NULL;
}
-static BOOL redirection_copy_data(char** dst, UINT32* plen, const char* str, UINT32 len)
+static BOOL redirection_copy_data(BYTE** dst, UINT32* plen, const BYTE* str, UINT32 len)
{
redirection_free_data(dst, plen);

View File

@@ -0,0 +1,33 @@
From: Alessandro Bono <alessandro.bono369@gmail.com>
Date: Wed, 8 May 2024 16:06:30 +0200
Subject: redirection: Fix incompatible pointer type
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This fixes the following:
```
libfreerdp/core/redirection.c: In function freerdp_settings_set_pointer_len:
libfreerdp/core/redirection.c:112:31: error: assignment to BYTE ** {aka unsigned char **} from incompatible pointer type char ** [-Wincompatible-pointer-types]
112 | pdata = &settings->TargetNetAddress;
| ^
```
(cherry picked from commit 7894a7dfc5f811cb5dacc57a09236c11744b1ec8)
---
libfreerdp/core/redirection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libfreerdp/core/redirection.c b/libfreerdp/core/redirection.c
index 63bc8cc..4872d4b 100644
--- a/libfreerdp/core/redirection.c
+++ b/libfreerdp/core/redirection.c
@@ -109,7 +109,7 @@ static BOOL freerdp_settings_set_pointer_len(rdpSettings* settings, size_t id, c
switch (id)
{
case FreeRDP_TargetNetAddress:
- pdata = &settings->TargetNetAddress;
+ pdata = (BYTE**)&settings->TargetNetAddress;
plen = &settings->TargetNetAddressCount;
break;
case FreeRDP_LoadBalanceInfo:

View File

@@ -0,0 +1,24 @@
From: Mike Gilbert <floppym@gentoo.org>
Date: Wed, 22 May 2024 17:04:43 -0400
Subject: X11: fix pointer/integer type mismatch
Fixed on master in 2da280b8a1748052b70b3f5a1ef0d8e932c33adc.
(cherry picked from commit d2b6771c748e54e659d5f1243a92e499c3beaa36)
---
client/X11/xf_graphics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/X11/xf_graphics.c b/client/X11/xf_graphics.c
index 5aa1fd4..fe81e0e 100644
--- a/client/X11/xf_graphics.c
+++ b/client/X11/xf_graphics.c
@@ -438,7 +438,7 @@ static BOOL xf_Pointer_New(rdpContext* context, rdpPointer* pointer)
#endif
fail:
- WLog_DBG(TAG, "%s: %ld", __func__, rc ? pointer : -1);
+ WLog_DBG(TAG, "%s: %p", __func__, rc ? pointer : NULL);
return rc;
}

View File

@@ -0,0 +1,22 @@
From: akallabeth <akallabeth@posteo.net>
Date: Thu, 23 May 2024 09:30:33 +0200
Subject: [client,wayland] fix const correctness
(cherry picked from commit 67818bddb31900cdf3acb26cb0b673cc90b71cc9)
---
client/Wayland/wlfreerdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/Wayland/wlfreerdp.c b/client/Wayland/wlfreerdp.c
index 65e29bc..5988aed 100644
--- a/client/Wayland/wlfreerdp.c
+++ b/client/Wayland/wlfreerdp.c
@@ -587,7 +587,7 @@ static void wlf_client_free(freerdp* instance, rdpContext* context)
DeleteCriticalSection(&wlf->critical);
}
-static void* uwac_event_clone(const void* val)
+static void* uwac_event_clone(void* val)
{
UwacEvent* copy;
UwacEvent* ev = (UwacEvent*)val;

View File

@@ -0,0 +1,89 @@
From: Armin Novak <armin.novak@thincast.com>
Date: Thu, 8 Aug 2024 11:03:24 +0200
Subject: [warnings] fix -Wincompatible-pointer-types
(cherry picked from commit 5b2b53b15c9af46b85c4ef0007e7fb59d7608289)
---
channels/ainput/server/ainput_main.c | 8 ++++----
libfreerdp/codec/dsp_ffmpeg.c | 2 +-
winpr/libwinpr/crt/unicode.c | 8 ++++----
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/channels/ainput/server/ainput_main.c b/channels/ainput/server/ainput_main.c
index 943d0fa..fc61f9b 100644
--- a/channels/ainput/server/ainput_main.c
+++ b/channels/ainput/server/ainput_main.c
@@ -222,7 +222,7 @@ static HANDLE ainput_server_get_channel_handle(ainput_server* ainput)
WINPR_ASSERT(ainput);
- if (WTSVirtualChannelQuery(ainput->ainput_channel, WTSVirtualEventHandle, &buffer,
+ if (WTSVirtualChannelQuery(ainput->ainput_channel, WTSVirtualEventHandle, (void**)&buffer,
&BytesReturned) == TRUE)
{
if (BytesReturned == sizeof(HANDLE))
@@ -416,7 +416,7 @@ ainput_server_context* ainput_server_context_new(HANDLE vcm)
goto fail;
return &ainput->context;
fail:
- ainput_server_context_free(ainput);
+ ainput_server_context_free(&ainput->context);
return NULL;
}
@@ -539,8 +539,8 @@ UINT ainput_server_context_poll_int(ainput_server_context* context)
BYTE* buffer = NULL;
DWORD BytesReturned = 0;
- if (WTSVirtualChannelQuery(ainput->ainput_channel, WTSVirtualChannelReady, &buffer,
- &BytesReturned) != TRUE)
+ if (WTSVirtualChannelQuery(ainput->ainput_channel, WTSVirtualChannelReady,
+ (void**)&buffer, &BytesReturned) != TRUE)
{
WLog_ERR(TAG, "WTSVirtualChannelReady failed,");
}
diff --git a/libfreerdp/codec/dsp_ffmpeg.c b/libfreerdp/codec/dsp_ffmpeg.c
index ef67914..80df188 100644
--- a/libfreerdp/codec/dsp_ffmpeg.c
+++ b/libfreerdp/codec/dsp_ffmpeg.c
@@ -423,7 +423,7 @@ static BOOL ffmpeg_encode_frame(AVCodecContext* context, AVFrame* in, AVPacket*
uint8_t** pp = in->extended_data;
for (int y = 0; y < in->channels; y++)
{
- float* data = pp[y];
+ float* data = (float*)pp[y];
for (int x = 0; x < in->nb_samples; x++)
{
const float val1 = data[x];
diff --git a/winpr/libwinpr/crt/unicode.c b/winpr/libwinpr/crt/unicode.c
index dc3533a..acbec01 100644
--- a/winpr/libwinpr/crt/unicode.c
+++ b/winpr/libwinpr/crt/unicode.c
@@ -215,8 +215,8 @@ int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int
else
{
targetLength =
- ucnv_convert("UTF-16LE", "UTF-8", targetStart, targetCapacity * sizeof(WCHAR),
- lpMultiByteStr, cbMultiByte, &error);
+ ucnv_convert("UTF-16LE", "UTF-8", (char*)targetStart,
+ targetCapacity * sizeof(WCHAR), lpMultiByteStr, cbMultiByte, &error);
if (targetLength > 0)
targetLength /= sizeof(WCHAR);
cchWideChar = U_SUCCESS(error) ? targetLength : 0;
@@ -353,14 +353,14 @@ int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int
#if defined(UCNV_CONVERT)
if (cbMultiByte == 0)
{
- targetLength = ucnv_convert("UTF-8", "UTF-16LE", NULL, 0, lpWideCharStr,
+ targetLength = ucnv_convert("UTF-8", "UTF-16LE", NULL, 0, (char*)lpWideCharStr,
cchWideChar * sizeof(WCHAR), &error);
cbMultiByte = targetLength;
}
else
{
targetLength = ucnv_convert("UTF-8", "UTF-16LE", targetStart, targetCapacity,
- lpWideCharStr, cchWideChar * sizeof(WCHAR), &error);
+ (char*)lpWideCharStr, cchWideChar * sizeof(WCHAR), &error);
cbMultiByte = U_SUCCESS(error) ? targetLength : 0;
}

View File

@@ -0,0 +1,48 @@
From: Armin Novak <armin.novak@thincast.com>
Date: Thu, 8 Aug 2024 11:06:54 +0200
Subject: [server,proxy] deactivate capture module
the module does not work (and did not for a long time)
(cherry picked from commit be23ed4ba990bd39391a651444fbb9130722c93b)
---
server/proxy/modules/capture/CMakeLists.txt | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/server/proxy/modules/capture/CMakeLists.txt b/server/proxy/modules/capture/CMakeLists.txt
index 80ba3b7..4004aaa 100644
--- a/server/proxy/modules/capture/CMakeLists.txt
+++ b/server/proxy/modules/capture/CMakeLists.txt
@@ -17,17 +17,19 @@
# limitations under the License.
#
-set(PLUGIN_NAME "proxy-capture-plugin")
+# deactivated: does not work
-add_library(${PLUGIN_NAME} MODULE
- cap_main.c
- cap_config.c
- cap_config.h
- cap_protocol.c
- cap_protocol.h
-)
-
-set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
-set_target_properties(${PLUGIN_NAME} PROPERTIES NO_SONAME 1)
-set_target_properties(${PLUGIN_NAME} PROPERTIES
-LIBRARY_OUTPUT_DIRECTORY "${FREERDP_PROXY_PLUGINDIR}")
+#set(PLUGIN_NAME "proxy-capture-plugin")
+#
+#add_library(${PLUGIN_NAME} MODULE
+# cap_main.c
+# cap_config.c
+# cap_config.h
+# cap_protocol.c
+# cap_protocol.h
+#)
+#
+#set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
+#set_target_properties(${PLUGIN_NAME} PROPERTIES NO_SONAME 1)
+#set_target_properties(${PLUGIN_NAME} PROPERTIES
+#LIBRARY_OUTPUT_DIRECTORY "${FREERDP_PROXY_PLUGINDIR}")

View File

@@ -1,3 +1,22 @@
-------------------------------------------------------------------
Fri Oct 24 07:57:48 UTC 2025 - Yifan Jiang <yfjiang@suse.com>
- Update 0001-Fix-build-with-ffmpeg-7.patch: fix build issue in
h264_ffmpeg.c.
-------------------------------------------------------------------
Sat Oct 5 08:05:54 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Add upstream fixes (picked from Debian) (boo#1231317)
* 0001-info-Fix-incompatible-pointer-type.patch
* 0002-redirection-Fix-incompatible-pointer-type.patch
* 0003-redirection-Fix-incompatible-pointer-type.patch
* 0004-X11-fix-pointer-integer-type-mismatch.patch
* 0005-client-wayland-fix-const-correctness.patch
* 0006-warnings-fix-Wincompatible-pointer-types.patch
* 0007-server-proxy-deactivate-capture-module.patch
* 0001-Fix-build-with-ffmpeg-7.patch
-------------------------------------------------------------------
Mon Jun 3 16:39:14 UTC 2024 - Hans-Peter Jansen <hpj@urpla.net>

View File

@@ -1,7 +1,7 @@
#
# spec file for package freerdp2
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -43,11 +43,21 @@ URL: https://www.freerdp.com/
Source0: https://github.com/FreeRDP/FreeRDP/releases/download/%{version}/freerdp-%{version}.tar.gz
Source1: freerdp2-rpmlintrc
# PATCH-FIX-UPSTREAM https://github.com/FreeRDP/FreeRDP/pull/7476
Patch1: 0001-Make-H.264-codec-optional-during-runtime.patch
Patch0: 0001-Make-H.264-codec-optional-during-runtime.patch
# PATCH-FIX-OPENSUSE -- Don't let 'cmake(WinPR)' require unneeded tools
Patch2: 0001-Don-t-add-winpr-cli-tools-to-exported-CMake-targets.patch
Patch1: 0001-Don-t-add-winpr-cli-tools-to-exported-CMake-targets.patch
# PATCH-FIX-UPSTREAM freerdp-CVE-2024-32661.patch CVE-2024-32661 bsc#1223348 yu.daike@suse.com -- client NULL pointer dereference
Patch3: freerdp-CVE-2024-32661.patch
Patch2: freerdp-CVE-2024-32661.patch
# PATCH-FIX-UPSTREAM -- gcc 14 compat
Patch3: 0001-info-Fix-incompatible-pointer-type.patch
Patch4: 0002-redirection-Fix-incompatible-pointer-type.patch
Patch5: 0003-redirection-Fix-incompatible-pointer-type.patch
Patch6: 0004-X11-fix-pointer-integer-type-mismatch.patch
Patch7: 0005-client-wayland-fix-const-correctness.patch
Patch8: 0006-warnings-fix-Wincompatible-pointer-types.patch
Patch9: 0007-server-proxy-deactivate-capture-module.patch
# PATCH-FIX-UPSTREAM -- ffmpeg 7 compat
Patch10: 0001-Fix-build-with-ffmpeg-7.patch
BuildRequires: cmake >= 2.8
BuildRequires: cups-devel
BuildRequires: ed