freerdp2 new package
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
From d8dc2956e5df589ca0766d88797f1cd4dbb10882 Mon Sep 17 00:00:00 2001
|
||||
From: akallabeth <akallabeth@posteo.net>
|
||||
Date: Tue, 22 Oct 2024 11:02:11 +0200
|
||||
Subject: [PATCH] [codec,color] fix overlapping check
|
||||
|
||||
only consider images that do not contain the same lines not overlapping.
|
||||
Ignore any x offsets as this may lead to alignment problems resulting in
|
||||
invalid overlapping areas.
|
||||
---
|
||||
libfreerdp/codec/color.c | 37 ++++++++++++++-----------------------
|
||||
1 file changed, 14 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/libfreerdp/codec/color.c b/libfreerdp/codec/color.c
|
||||
index 3d4060638c2d..dff567f60647 100644
|
||||
--- a/libfreerdp/codec/color.c
|
||||
+++ b/libfreerdp/codec/color.c
|
||||
@@ -549,22 +549,20 @@ BOOL freerdp_image_copy_from_pointer_data(BYTE* WINPR_RESTRICT pDstData, UINT32
|
||||
}
|
||||
}
|
||||
|
||||
-static INLINE BOOL overlapping(const BYTE* pDstData, UINT32 nXDst, UINT32 nYDst, UINT32 nDstStep,
|
||||
- UINT32 dstBytesPerPixel, const BYTE* pSrcData, UINT32 nXSrc,
|
||||
- UINT32 nYSrc, UINT32 nSrcStep, UINT32 srcBytesPerPixel,
|
||||
- UINT32 nWidth, UINT32 nHeight)
|
||||
+static INLINE BOOL overlapping(const BYTE* pDstData, UINT32 nYDst, UINT32 nDstStep,
|
||||
+ const BYTE* pSrcData, UINT32 nYSrc, UINT32 nSrcStep, UINT32 nHeight)
|
||||
{
|
||||
- const BYTE* pDstStart = &pDstData[1ULL * nXDst * dstBytesPerPixel + 1ULL * nYDst * nDstStep];
|
||||
- const BYTE* pDstEnd = pDstStart + 1ULL * nHeight * nDstStep;
|
||||
- const BYTE* pSrcStart = &pSrcData[1ULL * nXSrc * srcBytesPerPixel + 1ULL * nYSrc * nSrcStep];
|
||||
- const BYTE* pSrcEnd = pSrcStart + 1ULL * nHeight * nSrcStep;
|
||||
-
|
||||
- WINPR_UNUSED(nWidth);
|
||||
-
|
||||
- if ((pDstStart >= pSrcStart) && (pDstStart <= pSrcEnd))
|
||||
+ const uintptr_t src = (uintptr_t)pSrcData;
|
||||
+ const uintptr_t srcstart = src + 1ULL * nSrcStep * nYSrc;
|
||||
+ const uintptr_t srcend = srcstart + 1ULL * nSrcStep * nHeight;
|
||||
+ const uintptr_t dst = (uintptr_t)pDstData;
|
||||
+ const uintptr_t dststart = dst + 1ULL * nDstStep * nYDst;
|
||||
+ const uintptr_t dstend = dststart + 1ULL * nDstStep * nHeight;
|
||||
+
|
||||
+ if ((dststart >= srcstart) && (dststart <= srcend))
|
||||
return TRUE;
|
||||
|
||||
- if ((pDstEnd >= pSrcStart) && (pDstEnd <= pSrcEnd))
|
||||
+ if ((dstend >= srcstart) && (dstend <= srcend))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
@@ -733,8 +731,7 @@ BOOL freerdp_image_copy_overlap(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep
|
||||
SSIZE_T dstVOffset = 0;
|
||||
SSIZE_T dstVMultiplier = 1;
|
||||
|
||||
- WINPR_ASSERT(overlapping(pDstData, nXDst, nYDst, nDstStep, dstByte, pSrcData, nXSrc, nYSrc,
|
||||
- nSrcStep, srcByte, nWidth, nHeight));
|
||||
+ WINPR_ASSERT(overlapping(pDstData, nYDst, nDstStep, pSrcData, nYSrc, nSrcStep, nHeight));
|
||||
|
||||
if ((nWidth == 0) || (nHeight == 0))
|
||||
return TRUE;
|
||||
@@ -851,9 +848,6 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32
|
||||
DWORD SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc,
|
||||
const gdiPalette* WINPR_RESTRICT palette, UINT32 flags)
|
||||
{
|
||||
- const UINT32 dstByte = FreeRDPGetBytesPerPixel(DstFormat);
|
||||
- const UINT32 srcByte = FreeRDPGetBytesPerPixel(SrcFormat);
|
||||
-
|
||||
if ((nHeight > INT32_MAX) || (nWidth > INT32_MAX))
|
||||
return FALSE;
|
||||
|
||||
@@ -869,8 +863,7 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32
|
||||
if (nSrcStep == 0)
|
||||
nSrcStep = nWidth * FreeRDPGetBytesPerPixel(SrcFormat);
|
||||
|
||||
- const BOOL ovl = overlapping(pDstData, nXDst, nYDst, nDstStep, dstByte, pSrcData, nXSrc, nYSrc,
|
||||
- nSrcStep, srcByte, nWidth, nHeight);
|
||||
+ const BOOL ovl = overlapping(pDstData, nYDst, nDstStep, pSrcData, nYSrc, nSrcStep, nHeight);
|
||||
if (ovl)
|
||||
return freerdp_image_copy_overlap(pDstData, DstFormat, nDstStep, nXDst, nYDst, nWidth,
|
||||
nHeight, pSrcData, SrcFormat, nSrcStep, nXSrc, nYSrc,
|
||||
@@ -1611,9 +1604,7 @@ BOOL freerdp_image_copy_no_overlap(BYTE* WINPR_RESTRICT pDstData, DWORD DstForma
|
||||
if (!prims)
|
||||
prims = primitives_get();
|
||||
|
||||
- WINPR_ASSERT(!overlapping(pDstData, nXDst, nYDst, nDstStep, FreeRDPGetBytesPerPixel(DstFormat),
|
||||
- pSrcData, nXSrc, nYSrc, nSrcStep, FreeRDPGetBytesPerPixel(SrcFormat),
|
||||
- nWidth, nHeight));
|
||||
+ WINPR_ASSERT(!overlapping(pDstData, nYDst, nDstStep, pSrcData, nYSrc, nSrcStep, nHeight));
|
||||
WINPR_ASSERT(prims);
|
||||
WINPR_ASSERT(prims->copy_no_overlap);
|
||||
return prims->copy_no_overlap(pDstData, DstFormat, nDstStep, nXDst, nYDst, nWidth, nHeight,
|
||||
@@ -1,77 +0,0 @@
|
||||
diff -rupN a/channels/drdynvc/tsmf/ffmpeg/tsmf_ffmpeg.c b/channels/drdynvc/tsmf/ffmpeg/tsmf_ffmpeg.c
|
||||
--- a/channels/drdynvc/tsmf/ffmpeg/tsmf_ffmpeg.c 2013-01-02 22:46:59.000000000 +0100
|
||||
+++ b/channels/drdynvc/tsmf/ffmpeg/tsmf_ffmpeg.c 2013-07-22 18:12:18.001576713 +0200
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "tsmf_constants.h"
|
||||
#include "tsmf_decoder.h"
|
||||
|
||||
+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
|
||||
+
|
||||
/* Compatibility with older FFmpeg */
|
||||
#if LIBAVUTIL_VERSION_MAJOR < 50
|
||||
#define AVMEDIA_TYPE_VIDEO 0
|
||||
@@ -39,7 +41,7 @@ typedef struct _TSMFFFmpegDecoder
|
||||
ITSMFDecoder iface;
|
||||
|
||||
int media_type;
|
||||
- enum CodecID codec_id;
|
||||
+ enum AVCodecID codec_id;
|
||||
AVCodecContext* codec_context;
|
||||
AVCodec* codec;
|
||||
AVFrame* frame;
|
||||
@@ -54,7 +56,7 @@ static boolean tsmf_ffmpeg_init_context(
|
||||
{
|
||||
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
|
||||
|
||||
- mdecoder->codec_context = avcodec_alloc_context();
|
||||
+ mdecoder->codec_context = avcodec_alloc_context3(NULL);
|
||||
if (!mdecoder->codec_context)
|
||||
{
|
||||
DEBUG_WARN("avcodec_alloc_context failed.");
|
||||
@@ -88,16 +90,6 @@ static boolean tsmf_ffmpeg_init_audio_st
|
||||
mdecoder->codec_context->channels = media_type->Channels;
|
||||
mdecoder->codec_context->block_align = media_type->BlockAlign;
|
||||
|
||||
-#ifdef AV_CPU_FLAG_SSE2
|
||||
- mdecoder->codec_context->dsp_mask = AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_MMX2;
|
||||
-#else
|
||||
-#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
- mdecoder->codec_context->dsp_mask = FF_MM_SSE2 | FF_MM_MMXEXT;
|
||||
-#else
|
||||
- mdecoder->codec_context->dsp_mask = FF_MM_SSE2 | FF_MM_MMX2;
|
||||
-#endif
|
||||
-#endif
|
||||
-
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -174,7 +166,7 @@ static boolean tsmf_ffmpeg_prepare(ITSMF
|
||||
{
|
||||
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
|
||||
|
||||
- if (avcodec_open(mdecoder->codec_context, mdecoder->codec) < 0)
|
||||
+ if (avcodec_open2(mdecoder->codec_context, mdecoder->codec, NULL) < 0)
|
||||
{
|
||||
DEBUG_WARN("avcodec_open failed.");
|
||||
return false;
|
||||
@@ -372,8 +364,9 @@ static boolean tsmf_ffmpeg_decode_audio(
|
||||
av_init_packet(&pkt);
|
||||
pkt.data = (uint8*) src;
|
||||
pkt.size = src_size;
|
||||
- len = avcodec_decode_audio3(mdecoder->codec_context,
|
||||
- (int16_t*) dst, &frame_size, &pkt);
|
||||
+ AVFrame * frame = avcodec_alloc_frame ();
|
||||
+ len = avcodec_decode_audio4(mdecoder->codec_context,
|
||||
+ frame, &frame_size, &pkt);
|
||||
}
|
||||
#endif
|
||||
if (len <= 0 || frame_size <= 0)
|
||||
@@ -499,7 +492,6 @@ TSMFDecoderEntry(void)
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
- avcodec_init();
|
||||
avcodec_register_all();
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
diff -u -r -N old/include/freerdp/kbd/vkcodes.h new/include/freerdp/kbd/vkcodes.h
|
||||
--- old/include/freerdp/kbd/vkcodes.h 2013-09-19 12:46:07.124339712 +0200
|
||||
+++ new/include/freerdp/kbd/vkcodes.h 2013-09-19 12:45:51.621005583 +0200
|
||||
@@ -434,7 +434,7 @@
|
||||
{ 0x00, 0, "VK_SEPARATOR" , NULL },
|
||||
{ 0x4A, 0, "VK_SUBTRACT" , "KPSU" },
|
||||
{ 0x53, 0, "VK_DECIMAL" , "KPDL" },
|
||||
- { 0x35, 0, "VK_DIVIDE" , "KPDV" },
|
||||
+ { 0x35, 1, "VK_DIVIDE" , "KPDV" },
|
||||
{ 0x3B, 0, "VK_F1" , "FK01" },
|
||||
{ 0x3C, 0, "VK_F2" , "FK02" },
|
||||
{ 0x3D, 0, "VK_F3" , "FK03" },
|
||||
Reference in New Issue
Block a user