Commit Graph

933 Commits

Author SHA1 Message Date
akallabeth
f1bf99f075 Only build RFX neon path with -DWITH_NEON=ON
(cherry picked from commit d18187c949)
2022-05-04 09:41:01 +02:00
Armin Novak
50bc2d59e8 Fixed #7158: detection of arm neon.
(cherry picked from commit 6e075a6a7d)
2022-04-28 08:02:01 +02:00
Armin Novak
fb50329a9d Fixed #7837: Overallocate zgfx output buffers
Some decoders require additional byte alignment to prevent out
of bound reads

(cherry picked from commit ce60606e19)
2022-04-27 18:45:36 +02:00
Armin Novak
a923f59c20 Fixed #7745: Progressive surface cleanup
(cherry picked from commit edcb8284e7)
2022-04-06 11:02:18 +02:00
Armin Novak
2008751c04 Replaced WINPR_ASSERT defines, use include 2022-03-28 12:08:51 +02:00
Armin Novak
79207e6700 rfx_process_message verbose error log
(cherry picked from commit c194a68b1b)
2022-03-08 15:35:54 +01:00
akallabeth
b076803219 Added openH264 decoder frame flush
(cherry picked from commit 366ad75bb4)
2022-02-28 08:51:58 +01:00
akallabeth
9299d2fce1
Fix #7586: Update size of tile cache if required. (#7603)
(cherry picked from commit e0660ba694)
2022-01-28 09:07:35 +01:00
Armin Novak
3dfe3e8b57 Fixed too eager assert.
(cherry picked from commit 2ed5a6912b)
2022-01-26 12:38:11 +01:00
Armin Novak
4b73d86880 Removed x264 related files from build 2022-01-26 12:10:47 +01:00
Armin Novak
f41a4656d8 Added missing include
(cherry picked from commit 4867dea562)
2022-01-26 10:48:26 +01:00
Armin Novak
4744643dc1 Fixed statement expressions and missing goto
(cherry picked from commit adcec5d928)
2022-01-26 10:48:26 +01:00
Armin Novak
4101fe3be7 Added code assertions, fixed loading order
(cherry picked from commit 92d56b77f5)
2022-01-26 10:48:26 +01:00
Ely Ronnen
7cc9a10e8e handling small input buffer case
(cherry picked from commit 5c2916aa59)
2022-01-26 10:48:26 +01:00
Ely Ronnen
27a955a780 import libmediandk.so dynamically
(cherry picked from commit 5fbaeea425)
2022-01-26 10:48:26 +01:00
Ely Ronnen
8adbb187be adding mediacodec h264 implementation using NDK
(cherry picked from commit afe6cc10bd)
2022-01-26 10:48:26 +01:00
David Runge
95b0759feb Guard avcodec_register_all() calls
{channels/tsmf/client/ffmpeg/tsmf,libfreerdp/codec/dsp}_ffmpeg.c:
Guard calls to `avcodec_register_all()` against use beyond
`AV_VERSION_INT(58, 10, 100)`, where upstream ffmpeg made it obsolete.

(cherry picked from commit 811d94c742)
2022-01-25 09:15:19 +01:00
Armin Novak
a87c2a28fe Fixed missing ffmpeg deprecation guard
(cherry picked from commit 3303a2feaf)
2022-01-24 11:56:47 +01:00
akallabeth
537a877627 Replace fopen and path functions with wrappers (#7043)
Functions like fopen, PathFileExists, PathMakePath need to call
the wide character versions on windows for utf-8 support.

(cherry picked from commit 6b36c6d417)
2021-07-27 11:57:33 +02:00
Armin Novak
c311a1c695 Fixed issues with planar codec buffer alignment
Align width and height to next multiple of 4 to avoid issues with
internal buffer sizes.

(cherry picked from commit c2049673be)
2021-06-02 13:44:47 +02:00
Pascal Nowack
6bd82d4efa codec/progressive: Allow the usage of multithreading for decoding
While decoding RemoteFX encoded frames is multithreaded, decoding
RemoteFX Progressive frames is not, although both codecs work
relatively similarly.
This is especially noticeable with frames, that have a resolution
larger than 1920x1080 pixels.

decompress_tile_first() and decompress_tile_upgrade() can both run in
different threads at the same time for different tiles without necessary
adjustments.

So, do exactly that using the ThreadPool that already exists in the
RFX_CONTEXT to decrease the decoding time and therefore increase the
performance.
On a 3K display (2880x1620 pixels) this makes out of a choppy
experience a fluid experience.

(cherry picked from commit e79fefe21c)
2021-05-25 15:30:50 +02:00
Pascal Nowack
228243b333 codec/progressive: Fix a memory leak
When checking whether tiles and updatedTileIndices are both non-NULL,
one of them might be NULL, while the other struct member might not
be NULL and progressive_surface_context_new() leaks then the non-NULL
struct member.

Fix this by freeing both struct members, when aborting in
progressive_surface_context_new().
free() will take no action on pointers that are NULL, so no additional
check is needed.

(cherry picked from commit 805dc60e14)
2021-05-25 15:30:50 +02:00
Armin Novak
93b87ed417 Added version check for deprecated ffmpeg symbols
(cherry picked from commit 80b25de1a8)
2021-05-25 15:30:50 +02:00
akallabeth
7beda29158 Fixed CodeQL warnings
(cherry picked from commit 95a9e60827)
2021-03-12 12:41:44 +01:00
Armin Novak
602fb7d788 Added missing bounds check.
(cherry picked from commit 2e6069d95b)
2021-03-12 11:22:12 +01:00
Armin Novak
bd3f9cfd9f Added fuzzying test for planar decoder
(cherry picked from commit 9bbc2cd094)
2021-03-12 11:22:12 +01:00
Armin Novak
048aca5cce Compatibility changes
Renamed symbols and added wrappers to keep API compatible with
2.0 branch.
2021-02-25 09:51:41 +01:00
Vic Lee
f2d09e6eb0 progressive: fix multiple regions in one gfx frame.
(cherry picked from commit 7f94095a06)
2021-02-25 09:51:41 +01:00
Nathan Loewen
d2b684ff40 let freerdp_image_scale() determine step size
(cherry picked from commit cba6181154)
2021-02-25 09:51:41 +01:00
akallabeth
0195aac2ea Respect invalidRegion in progressive_compress
(cherry picked from commit 4a7ec674e6)
2021-02-25 09:51:41 +01:00
akallabeth
1a4c1de6a8 Fixed progressive decoding without subbanddiff
(cherry picked from commit e3445eefab)
2021-02-25 09:51:41 +01:00
akallabeth
84693e93b6 Cleaned up rfx API
(cherry picked from commit 25a8abc4eb)
2021-02-25 09:51:41 +01:00
Armin Novak
cbf2a59dd9 Fixed unit tests run under memory sanitizer
(cherry picked from commit 816e792e3f)
2021-02-25 09:51:41 +01:00
Armin Novak
8d62ec233d Fixed const correctness of RECTANGLE_16 variable
(cherry picked from commit 9549d090ab)
2021-02-25 09:51:41 +01:00
Armin Novak
847de7f4ae Fix ColorFidelity use
(cherry picked from commit 8187ab7732)
2021-02-25 09:51:41 +01:00
akallabeth
db20214c1f Backported #6670: Progressive decoding of subbanddiff
Properly decode tiles without subbanddiff so connections with
xfreerdp /gfx /v:<foo> work with ogon and the required progressive
codec is correct.
2020-12-15 17:00:22 +01:00
Fabio Fantoni
99ebaacda6 remove unwanted log level set to debug in rfx
I saw on debian packages (that have -DWITH_DEBUG_ALL=ON) remotefx logs always to
debug without respect log-level and log-filters settings making diffult
debugging of issue on other parts.
After a search I found this that set loglevel to debug that akallabeth confirmed
is unwanted, this patch remove it.

Closes #6606

(cherry picked from commit f3e5ebe315)
2020-12-01 15:10:23 +01:00
Armin Novak
6004eefec5 Fixed missing input length check for color pointer.
(cherry picked from commit 47d02a76ce)
2020-12-01 15:10:23 +01:00
Armin Novak
e805752c4e Fixed compilation warnings.
(cherry picked from commit 57b405ca26)
2020-12-01 15:10:23 +01:00
akallabeth
cb03d8701d Filter GSM codec for microphone redirection
(cherry picked from commit c5984ff811)
2020-07-06 11:13:26 +02:00
Pascal Nowack
b898786263 nsc: Fix memory leak
Fixes the following memory leak:

==115716== 16,662,960 bytes in 459 blocks are definitely lost in loss record 3,504 of 3,504
==115716==    at 0x48396AF: malloc (vg_replace_malloc.c:306)
==115716==    by 0x4C6A4E2: nsc_context_initialize_encode (nsc_encode.c:77)
==115716==    by 0x4C6A4E2: nsc_compose_message (nsc_encode.c:497)

(cherry picked from commit 9bd4574050)
2020-06-29 08:13:05 +02:00
akallabeth
6780420343 Fixed out of bound read in RLEDECOMPRESS
CVE-2020-4033 thanks to @antonio-morales for finding this.

(cherry picked from commit 0a98c450c5)
2020-06-22 12:13:13 +02:00
akallabeth
072b3d9a00 Fixed #6267: adjust write_pixel_16 endian handling
(cherry picked from commit 51d3e07c8a)
2020-06-16 09:09:11 +02:00
Kobi Mizrachi
6e87805869 codec: fix typo in progressive codec log
(cherry picked from commit 8d72051ab1)
2020-05-20 15:41:24 +02:00
akallabeth
cf4f6dbf3f Fixed multiple sanitizer errors in codecs
(cherry picked from commit 2278d92a5d902692a7d1088629b2345c9b4e229c)
2020-05-20 15:41:24 +02:00
akallabeth
2e28385fbb Fixed history buffer reset.
(cherry picked from commit ccc9cbef2d5d0d9f5cf5ec7621f71bed33f41aba)
2020-05-18 17:10:01 +02:00
akallabeth
11c6ed0fb7 Fixed undefined behaviour in ncrush
(cherry picked from commit 83137d2a1bb732fbea2f20778924a50a79f63fef)
2020-05-18 17:10:01 +02:00
akallabeth
f25c2f265e Fixed undefined behaviour in rfx decoder
(cherry picked from commit ef611d34d61c6590429c17db5c97f0a9a33147e8)
2020-05-18 17:10:01 +02:00
akallabeth
37158cd17f Fixed UndefinedBehaviour in planar left shift
(cherry picked from commit 328691c46597c194f01a77a9d33d58b2faa88c9d)
2020-05-18 17:10:01 +02:00
akallabeth
96621d4f45 Always require aligned memory for interleaved codec.
(cherry picked from commit 20c11fb7178462a8ba36b4fdbfb3e2a03197356f)
2020-05-18 17:10:00 +02:00