Commit Graph

156 Commits

Author SHA1 Message Date
Armin Novak
d55690db23 Fixed RFX encoding. 2016-10-06 13:43:12 +02:00
Armin Novak
9ab04711fa Fixed shadow server color encoding. 2016-10-06 13:43:12 +02:00
Armin Novak
da956e0388 ... 2016-10-06 13:42:59 +02:00
Armin Novak
24599af991 More color fixes. 2016-10-06 13:42:58 +02:00
Armin Novak
df35c135d1 Fixed color conversion, unified GFX and updated API. 2016-10-06 13:42:58 +02:00
Marc-André Moreau
56f9b18276 libfreerdp-codec: fix error on empty RFX tileset, which can sometimes happen 2016-05-11 13:53:34 -04:00
Armin Novak
2e110c7f35 Fixed codec reset, now resetting resolution too.
H264 and others require the surface resolution to work properly.
This initializes the codecs and the resolution on reset.
2016-03-02 14:46:33 +01:00
Armin Novak
9b0ef3a4ec Fixed stdint.h and stdbool.h detection. 2016-02-02 18:28:15 +01:00
Bernhard Miklautz
d73c4898c1 Add build-config.h
build-config.h should contain configure/compile time settings that are
relevant for projects that use FreeRDP.

For example the compiled in plugin search paths.
2015-11-09 15:54:22 +01:00
MartinHaimberger
d4d360f6a4 Merge pull request #2859 from akallabeth/resource_leak_fix
Fixes API misuse and logic errors
2015-09-15 14:45:42 +02:00
Armin Novak
08f61e60ca Fixed zero length allocation. 2015-09-01 12:25:44 +02:00
Bernhard Miklautz
c0d1f5bac1 codec/rfx: update comment and remove WLog_ERR
With revision 17.0 of [MS-RDPRFX] the behavior when numRects == 0 is
documented.
This commit updates the comment and removes the error logging.
2015-08-28 10:36:56 +02:00
Norbert Federa
ac95b7274e Merge pull request #2727 from akallabeth/leak_fixes_reformat
Fixed leaks, NULL dereferences and broken init.
2015-06-26 15:01:08 +02:00
Armin Novak
e8bfa29bd2 Replaced registry keys with cmake defines. 2015-06-24 14:02:48 +02:00
Armin Novak
6698e24228 Fixed leaks, NULL dereferences and broken init. 2015-06-23 21:29:21 +02:00
Norbert Federa
25fc866a58 Fix unchecked CreateThread calls and misc fixes 2015-05-05 13:55:48 +02:00
Norbert Federa
ef1fd12b15 Fix unchecked CreateEvent calls and misc fixes
1)
Added missing checks for CreateEvent which also required the
following related changes:

- changed freerdp_context_new API to BOOL
- changed freerdp_peer_context_new API to BOOL
- changed pRdpClientNew callback to BOOL
- changed pContextNew callback to BOOL
- changed psPeerAccepted callback to BOOL
- changed psPeerContextNew callback to BOOL

2)
Fixed lots of missing alloc and error checks in the
changed code's neighbourhood.

3)
Check freerdp_client_codecs_prepare result to avoid segfaults
caused by using non-initialized codecs.

4)
Fixed deadlocks in x11 caused by missing xf_unlock_x11() calls
in some error handlers

5)
Some fixes in thread pool:
- DEFAULT_POOL assignment did not match TP_POOL definition
- don't free the pool pointer if it points to the static DEFAULT_POOL
- added error handling and cleanup in InitializeThreadpool
2015-04-29 18:18:39 +02:00
Norbert Federa
5926bbcf48 codec/rfx: simplification, segfault/malloc fixes
rfx_process_message_sync:
- simplified the check if the header messages got processed

rfx_process_message_tileset:
- ObjectPool_Take result was not checked
- fail if TS_RFX_TILE block type is not CBT_TILE
- CreateThreadpoolWork result was not checked
- post decoding loop code segfaulted in error case

rfx_decoder_tile_new:
- missing malloc check

rfx_message_free:
- segfault protection

rfx_write_message_tileset:
- segfault protection
2015-04-24 17:54:49 +02:00
Norbert Federa
84577b1ca7 codec/rfx: error checking and various fixes
- removed some unneeded null checks for free()
- fixed a memory leak in shadow_client
- removed rfx_compose_message_header from API

Changed the following functions to BOOL, check the result
where they are called and handle failures:
- rfx_compose_message
- rfx_compose_message_header
- rfx_write_tile
- rfx_write_message_tileset
- rfx_write_message_frame_begin
- rfx_write_message_region
- rfx_write_message_frame_end
- rfx_write_message

rfx_process_message:
- check memory allocation failures
- verify protocol-conform order of data messages to prevents memory
  leaks caused by repeated allocations
- verify that header messages were parsed/received before the
  data messages
- treat unknown rlgr mode as error
- fixed/added error handling
- fixed all callers to check/handle result

rfx_encode_message:
- fixed incorrect usage of realloc
- missing malloc check
- missing check of CreateThreadpoolWork
- correct cleanup on failure (threadpool, memory)
- check rfx_encode_message result

rfx_encode_messages:
- check rfx_split_message result
- correct cleanup on failure
- prevent memory leak on failure

rfx_write_message_context:
- fixed invalid channelId value (must be 0xFF for WBT_CONTEXT)

rfx_process_message_codec_versions:
- fixed invalid read size of codec_version (it is 16bit)

rfx_process_message_channels:
- verify protocol conform channelId value

rfx_process_message_region:
- replaced invalid reallocs with malloc
- read and verify regionType and numTileSets from stream

rfx_process_message_tileset:
- check allocation results
- fixed incorrect usages of realloc

setupWorkers:
- fixed incorrect usages of realloc

rfx_split_message:
- removed dead code
- missing malloc check

rfx_compose_message:
- fixed a memory leak
- check/handle rfx_encode_message result
2015-04-23 15:42:21 +02:00
Bernhard Miklautz
74c8400789 coding style fixes
Add missing space after if
2015-03-30 17:15:45 +02:00
Bernhard Miklautz
f469e069dc stream: Stream_Ensure*Capacity: change return type
Change the return type of Stream_Ensure*Capacity from void to BOOL to be
able to detect realloc problems easily. Otherwise the only way to detect
this was to check if the capacity after the call was >= the required
size.
In case Stream_Ensure*Capacity fails the old memory is still available
and need to freed outside.

This commit also adds checks to most calls of Stream_Ensure*Capacity to
check if the call was successful.
2015-03-30 16:33:48 +02:00
Zhang Zhaolong
f0adff1812 codec: check return value of realloc.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 14:18:45 +08:00
Armin Novak
2f519d7f16 Replaced logging in libfreerdp with wlog defines. 2014-09-15 08:48:46 +02:00
Marc-André Moreau
198f94fe03 libfreerdp-gdi: add RDP8 graphics pipeline support 2014-09-12 14:57:44 -04:00
Marc-André Moreau
dc7f89dbd5 Merge branch 'egfx' of github.com:awakecoding/FreeRDP 2014-08-11 17:25:38 -04:00
Armin Novak
f4c133eaf8 Replaced custom logging mechanism with WLog wrapper. 2014-08-07 16:51:24 +02:00
Marc-André Moreau
22d3b6c74b libfreerdp-codec: remove old RemoteFX RLGR implementation in favour of faster one 2014-08-05 21:41:58 -04:00
Marc-André Moreau
ac7d23b9a3 libfreerdp-gdi: migrate to _aligned_malloc/_aligned_free 2014-07-08 15:07:19 -04:00
SBoyNumber1
f8c9f7a486 Fixed issue rfx problem: no rects #1738.
Added clipping of whole session in case when server sends zero rects.
2014-05-08 19:20:28 +03:00
Marc-André Moreau
004ad2123e libfreerdp-codec: fix typedef redefinitions 2014-02-28 16:17:36 -05:00
Marc-André Moreau
aca0b9996d Merge branch 'remoteFx_fix2' of https://github.com/hardening/FreeRDP into hardening-remoteFx_fix2
Conflicts:
	libfreerdp/codec/test/CMakeLists.txt
2014-02-15 11:06:09 -05:00
Marc-André Moreau
cdcd290c44 wfreerdp: fix most build warnings 2014-02-10 22:12:13 -05:00
Hardening
115a1e863d Fixes in intersection + checks
Fix a bug in the extents of an intersection.
Add some checks and assert that helps when using the remoteFx encoder.
A speedup for intersection when bands are above the target rect.
2014-02-07 17:10:29 +01:00
Hardening
0915060f40 Fixes before pullreq
Replaced zmalloc by calloc.
Moved region from utils to codec.
Fixed some typo and corner cases.
2014-02-05 16:24:46 +01:00
Hardening
4cc037d148 Some fixes after Norbert code review
There were a bug when the rectangles extents where not at the origin.
Some debugging statement have laso been removed.
2014-02-05 14:07:22 +01:00
Hardening
2d16d929b6 Fix remoteFx encoder with topleft and bottomright rectangle
This patch fixes the case where with a topleft and a bottomright
rectangle, the encoder would send the full screen instead of only the
intersected tiles.
2014-02-04 16:22:34 +01:00
Marc-André Moreau
a0c0d7b998 libfreerdp-core: added debug output for surface commands 2013-10-08 20:40:58 -04:00
Marc-André Moreau
ac2444ab50 libfreerdp-codec: start making use of WLog for RemoteFX 2013-10-08 20:17:57 -04:00
Marc-André Moreau
518995a05e freerdp: merge with master 2013-09-16 17:10:27 -04:00
Armin Novak
c986f30c4a Fixed smartcard related issues with double free. 2013-09-06 10:55:26 +02:00
Armin Novak
853bf40321 Fixed memory cleanup issue 2013-09-05 12:14:35 +02:00
Armin Novak
ddb664d6e7 Fixed memory leak. 2013-09-05 12:14:34 +02:00
Armin Novak
e5c138a5b9 Fixed various memory leaks, allocation size issues and API misuse
warnings shown by clang as well as some compiler warnings.
2013-09-05 12:14:34 +02:00
Armin Novak
a3b531c036 Fixed issues found with clang-analyzer 2013-09-05 12:14:33 +02:00
Armin Novak
75c0ecb362 Fixed coverity issue 1047564 2013-09-05 12:14:33 +02:00
Armin Novak
c05daf9f74 Fixed coverity issue 1047621 2013-09-05 12:14:31 +02:00
Marc-André Moreau
ee36541fb7 freerdp: merge with master 2013-09-03 18:49:48 -04:00
Vic Lee
86e783e4fb libfreerdp-codec/rfx: fix memory corruptions. 2013-09-03 20:27:08 +08:00
Marc-André Moreau
f69f4285b1 libfreerdp-codec: use partitioned buffers for RemoteFX encoding/decoding 2013-08-19 18:39:19 -04:00
Marc-André Moreau
0fd705c6c7 channels/cliprdr: start server-side implementation 2013-08-16 16:46:47 -04:00
Marc-André Moreau
08dce6e090 libfreerdp-codec: add support for passing pointer to beginning of buffer for RemoteFX encoding 2013-08-14 20:35:00 -04:00
Marc-André Moreau
2d3d5acf1e libfreerdp-codec: initial support for RemoteFX fragmented encoding 2013-08-14 13:19:01 -04:00
Marc-André Moreau
5e6325d62c libfreerdp-codec: start exporting split encode/write rfx api 2013-08-14 10:14:47 -04:00
Marc-André Moreau
dfbd4cb9fb libfreerdp-codec: refactor encoder to use message-centric interface 2013-08-13 17:50:05 -04:00
Marc-André Moreau
fe25303656 libfreerdp-codec: internal refactoring 2013-08-13 17:18:59 -04:00
Marc-André Moreau
c8b85e19a4 libfreerdp-codec: separate tile encoding from writing 2013-08-13 14:13:05 -04:00
Marc-André Moreau
4e6f1f5a4b libfreerdp-codec: use pooled buffers for channel encoding 2013-08-13 13:45:28 -04:00
Marc-André Moreau
482e836ad8 libfreerdp-codec: refactor internal rfx_compose_message_tile 2013-08-13 11:09:54 -04:00
Marc-André Moreau
916a4eee4b libfreerdp-codec: start making use of RFX_TILE structure for encoding 2013-08-13 10:30:22 -04:00
Marc-André Moreau
3e4dc73280 libfreerdp-codec: split stream parsing from tile decoding 2013-08-13 10:09:32 -04:00
Marc-André Moreau
b972830841 libfreerdp-codec: make use of ObjectPool for tiles 2013-08-13 09:34:15 -04:00
Marc-André Moreau
e91f2516e5 libfreerdp-codec: fix automatic growing of the encode stream size 2013-08-12 13:13:27 -04:00
Norbert Federa
ccc5d1b279 codec/rfx: fix multithreaded encoder
Some component of the encoder chain (I suspect the rlgr encoder) expects
the output buffer to be zeroed. The multithreaded RemoteFX encoder uses
wStreams from the StreamPool which are reused and not zeroed out of
course. For now, in order to prevent data corruption we clear the stream.
2013-08-10 00:28:35 +02:00
Norbert Federa
0d916527bc codec/rfx: added multithreaded encoder 2013-08-07 18:22:42 +02:00
Norbert Federa
938a0890a3 codec/rfx: removed unnecessary WaitForSingleObject
The WaitForSingleObject call on TilePool's event is called with a zero time-out
interval and the event is a manual reset event ... thus no locking or waiting
is involved anyways and Queue_Dequeue may very well return NULL independently
of calling WaitForSingleObject which is already correctly handled.
2013-07-30 13:02:43 +02:00
Norbert Federa
1d384ce863 codec/rfx: removed unused queue TileQueue
Declared, created, deleted but not used:

    git grep TileQueue
    libfreerdp/codec/rfx_types.h: wQueue* TileQueue;
    libfreerdp/codec/rfx.c:       context->priv->TileQueue = Queue_New(TRUE, -1, -1);
    libfreerdp/codec/rfx.c:       Queue_Free(context->priv->TileQueue);
2013-07-17 10:01:56 +02:00
Norbert Federa
b9c8ac6527 codec/rfx: use function pointer for rlgr codec
Option to switch the rlgr implementation during runtime - exactly
like we do it with the ycbcr, dwt and quantization functions.
2013-07-10 07:14:26 +02:00
Norbert Federa
df7526f888 codec/rfx: Fixed bufferpool size used for RemoteFX
y_r_buffer, cb_g_buffer, cr_b_buffer and dwt_buffer are all word arrays (16bit)
but obviously the bufferpool size was calculated based on the wrong assumption
that these are 32 bit values in commit 37a59efbe3
2013-07-05 12:30:13 +02:00
Norbert Federa
40976a91b7 utils/profiler: fix unix build 2013-06-27 13:43:29 +02:00
Norbert Federa
b2108839b0 utils: fix broken stopwatch implementation
Stopwatch (in the way it is used) must be able to measure the wall
clock time with high resolution but used clock() which is not
appropriate for this purpose:
On POSIX systems clock() returns the processor time used by the
program. On Windows clock() does measure the wall clock time but
has only a resolution of 1ms (if at all).
This also renders the freerdp profiler unusable.

This commit changes stopwatch to use the performance counters
on Windows and gettimeofday() for the rest.

Also added a warning about invalid profiling results to the
RemoteFX codec if rfxcontext->priv->UseThreads is enabled because
stopwatch is currently not used in a thread safe way.

Also see GitHub Issue #1325
2013-06-27 13:00:54 +02:00
Vic Lee
6551815991 libfreerdp-codec/rfx: fix a memory leak. 2013-06-20 12:10:01 +08:00
Vic Lee
b194ddc211 libfreerdp-codec/rfx: dwSize must be initialized. 2013-06-14 12:16:04 +08:00
Marc-André Moreau
fdf3ddcf9e freerdp: purge deprecated stream utils 2013-05-08 17:48:30 -04:00
Marc-André Moreau
fd230443c5 freerdp: purge old stream utils 2013-05-08 16:27:21 -04:00
Marc-André Moreau
5b92413843 freerdp: purge deprecated stream utils 2013-05-08 16:09:16 -04:00
Marc-André Moreau
b4cac74136 xfreerdp-server: fix RemoteFX encoding 2013-05-01 18:15:55 -04:00
Marc-André Moreau
51715636a5 freerdp: remove some deprecated stream utils 2013-04-29 22:35:15 -04:00
Marc-André Moreau
a8201b0d1b libwinpr-utils: combine old and new stream utils 2013-03-21 15:19:33 -04:00
Martin Fleisz
2e8a0983dd codec: Added padding to rfx buffers for SSE/NEON code 2013-03-05 17:36:26 +01:00
Bernhard Miklautz
23a7ef6c47 codec/rfx: use sysinfo to detect sse2/neon
This also moves (sse2) detection code out of the client into the decoder.
2013-03-01 09:02:14 +01:00
Martin Fleisz
b8fd4b5227 codec: Fixed NEON CPU detection compile issue, primitives_get race condition in rfx decoding 2013-02-22 03:37:39 -08:00
Martin Fleisz
1cfb4a4e77 codec: Fixed NEON detection and incorrect RFX decoding 2013-02-21 07:08:46 -08:00
Marc-André Moreau
f49c92d6fe Merge pull request #932 from hardening/remoteFxChecks
Add checks on RemoteFX
2013-02-02 13:30:54 -08:00
C-o-r-E
bbfc724db9 libfreerdp: fix slash 2013-01-30 19:56:58 -05:00
C-o-r-E
a39ef9980f Merge remote-tracking branch 'upstream/master' 2013-01-30 19:05:35 -05:00
Corey C
b23cde57a6 libfreerdp: missing include 2013-01-30 18:55:22 -05:00
hardening
ebfec72e88 Add checks on RemoteFX 2013-01-28 22:23:10 +01:00
Marc-André Moreau
ebefab1de4 libfreerdp-codec: add processor count detection and auto-enabling of threads in RemoteFX decoder 2013-01-23 19:21:14 -05:00
Marc-André Moreau
a5b66e3766 libfreerdp-codec: fix build on Windows 2013-01-23 11:48:31 -05:00
Marc-André Moreau
94ad538185 libfreerdp-codec: added registry keys for multithreaded RemoteFX decoder 2013-01-22 21:54:13 -05:00
Marc-André Moreau
22f374ac36 libfreerdp-codec: implement buffer pooling for RemoteFX 2013-01-22 21:24:04 -05:00
Marc-André Moreau
f5d9b06252 libwinpr-utils: added buffer pool 2013-01-22 20:36:08 -05:00
Marc-André Moreau
37a59efbe3 libfreerdp-codec: use _aligned_free for RemoteFX buffers 2013-01-22 18:32:17 -05:00
Marc-André Moreau
438a727c6b libfreerdp-codec: start parallel decoding of RemoteFX tiles 2013-01-22 18:14:50 -05:00
Marc-André Moreau
9a7bcbb084 libfreerdp-codec: remove old RemoteFX tile pool 2013-01-20 20:44:30 -05:00
Daryl Poe
b64408975d freerdp primitives library 2013-01-18 15:32:58 -07:00
Marc-André Moreau
8a32de3801 libfreerdp: purged source tree from deprecated memory utils 2012-11-21 21:22:06 -05:00
Marc-André Moreau
2a16183f5d libfreerdp-utils: remove deprecated calls to xnew() macro 2012-11-21 20:21:08 -05:00
Marc-André Moreau
9d064171a7 freerdp: get rid of old types 2012-10-09 03:26:39 -04:00
Marc-André Moreau
1bf8a45519 freerdp: change uint8, sint8, uint16, sint16 to BYTE, INT8, UINT16, INT16 2012-10-09 03:01:37 -04:00