Commit Graph

112 Commits

Author SHA1 Message Date
Martin Fleisz e059e3dea3 codec: Remove src format parameter from rfx_process_message
This parameter is not required. Default param is BGRX32
and if an other format is required rfx_codec_set_pixel_format
can be used.
2016-12-01 17:21:06 +01:00
akallabeth 215fbe8446 Merge pull request #3613 from mfleisz/rlgr_api_revamp
codec: Revamp of rfx rlgr API
2016-11-25 13:44:23 +01:00
Armin Novak d1e2dd3281 Moved format size calculation out of loop. 2016-11-24 10:01:45 +01:00
Martin Fleisz 6c9df44846 codec: Revamp of rfx rlgr API
This PR contains following changes:
- Give rlgr encode/decode APIs a similar interface
- Make rlgr encode API accessible again
- Make it possible to exchange rlgr functions
- Make use of RLGR1/3 defines instead of 0/1 in decoding
2016-11-23 13:21:59 +01:00
Armin Novak 9c50e1a635 Replaced _VF formats with copy flags. 2016-10-14 10:36:52 +02:00
Armin Novak 985ca171ff Respecting tile offsets. 2016-10-12 09:21:21 +02:00
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