Commit Graph

366 Commits

Author SHA1 Message Date
Armin Novak
d41d65575c Use bitmap color format in gdi_BitBlt 2017-02-14 16:02:12 +01:00
Armin Novak
f324b0ef9c Use aligned malloc/free for GFX surfaces/buffers 2017-02-14 16:02:11 +01:00
Martin Fleisz
5930d7e81b gdi: Allow changing buffer even if size remains the same 2017-02-14 09:52:44 +01:00
Armin Novak
8845b3ffa2 Added warning for unsupported color depth. 2017-02-06 10:31:43 +01:00
Armin Novak
df764f5aad Fixed GDI color decoding issues. 2017-02-01 11:02:23 +01:00
Martin Fleisz
99c9195218 Merge pull request #3694 from akallabeth/avc420_black_artifact_fix
Fixed solid fill command.
2017-01-13 09:24:52 +01:00
Armin Novak
8f58e7fc06 Initializing gdi.stride on resize. 2017-01-11 15:31:48 +01:00
Armin Novak
936e5a05dc Fixed solid fill command.
If the alpha channel must be ignored in this command.
2017-01-11 13:25:44 +01:00
Armin Novak
08606323d6 Fixed software GDI line to pen color. 2017-01-09 16:35:34 +01:00
Norbert Federa
f71b6b46e8 fix string format specifiers
- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
2016-12-16 13:48:43 +01:00
Armin Novak
514a33d435 Respecting color depth with RDP_CODEC_ID_NONE. 2016-12-07 13:22:52 +01:00
Armin Novak
d4b823d5cb Using a single codec context per session. 2016-12-07 13:22:00 +01:00
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
Armin Novak
d1e2dd3281 Moved format size calculation out of loop. 2016-11-24 10:01:45 +01:00
Martin Fleisz
06d47530b6 Merge pull request #3594 from akallabeth/line_draw_color_format
Fixed line drawing color format #3592
2016-11-18 12:46:14 +01:00
Armin Novak
1203315b50 Fixed line drawing color format #3592 2016-11-14 09:37:15 +01:00
Armin Novak
95a3144b34 Scanline alignment for GFX cache. 2016-10-31 07:56:10 +01:00
Armin Novak
f62d00445e Fixed surface alignment. 2016-10-28 11:54:34 +02:00
Martin Fleisz
f2abcaabc0 Merge pull request #3554 from akallabeth/color_refactor
Replaced _VF formats with copy flags.
2016-10-19 13:31:54 +02:00
Armin Novak
30b5b01cf1 Fixed invalid arguments for gdi_resize_ex 2016-10-18 15:16:58 +02:00
Armin Novak
9c50e1a635 Replaced _VF formats with copy flags. 2016-10-14 10:36:52 +02:00
Armin Novak
ae5689709c Fixed uninitialized variables. 2016-10-13 16:57:51 +02:00
Bernhard Miklautz
5a5f091b7c Merge pull request #3545 from akallabeth/legacy_rfx_fixes
Fixed Windows 7 RFX issues.
2016-10-13 13:01:53 +02:00
Armin Novak
714e704352 Color format for surface bits unified. 2016-10-12 09:32:59 +02:00
Armin Novak
8286fa4b96 Fixed format flip and offsets for GDI. 2016-10-11 18:50:01 +02:00
Armin Novak
c3058ba580 Optimized ROP for GDI_SRCCOPY and GDI_DSTCOPY. 2016-10-11 14:47:26 +02:00
Armin Novak
c2787d7c5f Optimized gdi_FillRect 2016-10-11 14:47:26 +02:00
Armin Novak
c405e1515e Inlined heavily used function. 2016-10-11 14:47:26 +02:00
Armin Novak
94c6473250 Inlined heavily used functions. 2016-10-11 14:47:26 +02:00
Armin Novak
404ae7d83c Fixed Windows 7 RFX issues. 2016-10-11 14:34:07 +02:00
Martin Fleisz
9afc0cca26 Merge pull request #3536 from akallabeth/memory_leak_fixes
Memory leak fixes
2016-10-11 09:29:49 +02:00
zihao.jiang
34b4bca119 Fix nsc client after after color conversion huge fix
nsc codec client doesn't work:
1. We should mark invalid region for software gdi
2. Checked the code before color conversion fix, the correct color format should be PIXEL_FORMAT_BGRX32_VF (corresponds to old PIXEL_FORMAT_XRGB32_VF)
3. For gdi:hw: xfc->bitmap_buffer is never used/initialized. However gdi->primary_buffer is always maintained. So use primary_buffer to hold the decoded bitmap data
2016-10-11 02:18:31 +08:00
Armin Novak
eecc4b189f Fixed leak in bitmap handling. 2016-10-10 10:42:14 +02:00
Armin Novak
649d270ccd Fixed GDI_RGN->null initialization. 2016-10-06 13:43:15 +02:00
Armin Novak
b8b84473a3 Fixed post disconnect hook. 2016-10-06 13:43:12 +02:00
Armin Novak
296bc026dc Fixed ellipse test. 2016-10-06 13:43:11 +02:00
Armin Novak
399c318187 Fixed test loop. 2016-10-06 13:43:11 +02:00
Armin Novak
161685b25c Fixed some more glyph chache bugs. 2016-10-06 13:43:11 +02:00
Armin Novak
dbab3dd7e3 Fixed tests and not intialized values. 2016-10-06 13:43:11 +02:00
Armin Novak
0c57065c73 GlyphCache: Erasing destination if not redundant. 2016-10-06 13:43:11 +02:00
Armin Novak
b7f32353f4 Fixed pattern checks. 2016-10-06 13:43:11 +02:00
Armin Novak
823b1ec2f0 Added proper brush support to fill rect. 2016-10-06 13:43:11 +02:00
Armin Novak
9471f82fea Fixed missing include preventing symbol export. 2016-10-06 13:43:11 +02:00
Armin Novak
44b8756617 Warning fixes. 2016-10-06 13:43:10 +02:00
Armin Novak
64c5d78b3f Fixed clang warnings. 2016-10-06 13:43:09 +02:00
Armin Novak
c7448c03fb Added FREERDP_LOCAL
CMake 2.8 does not support default visibility on windows.
To allow building tests add the FREERDP_LOCAL define for each
function that is internal to FreeRDP.
When build with testing these functions are exported and available
for use by tests.
2016-10-06 13:43:09 +02:00
Armin Novak
6d6b991c26 Fixed BitBlt function for overlapping areas. 2016-10-06 13:43:09 +02:00
Armin Novak
5554d805db Code cleanup. 2016-10-06 13:43:09 +02:00
Armin Novak
f16ffaefa7 Fixed glyph cache issues. 2016-10-06 13:43:08 +02:00
Armin Novak
b765374d32 Refactored BitBlt, implementing everything now. 2016-10-06 13:43:08 +02:00
Armin Novak
f17f1475d8 Fixed font drawing. 2016-10-06 13:43:08 +02:00
Armin Novak
dd9354d55f Added argument checks. 2016-10-06 13:43:08 +02:00
Armin Novak
844f7b7941 Made logging less verbose. 2016-10-06 13:43:08 +02:00
Armin Novak
b888059bd7 Fixed color conversion issues. 2016-10-06 13:43:08 +02:00
Armin Novak
ab4725dd5d Fixed error message parameter. 2016-10-06 13:43:07 +02:00
Armin Novak
896f500e7e Fixed h264 dummy init. 2016-10-06 13:43:06 +02:00
Armin Novak
bc5aa1be0c Added more GDI orders. 2016-10-06 13:43:06 +02:00
Armin Novak
984bec733f Simplified gdi_patblt 2016-10-06 13:43:05 +02:00
Armin Novak
d1a3362a8f Fixed windows software GDI issues. 2016-10-06 13:43:05 +02:00
Armin Novak
66cf000efd Fixed broken test. 2016-10-06 13:43:05 +02:00
Armin Novak
e3b43b991d Fixed some bitblt issues. 2016-10-06 13:43:05 +02:00
Armin Novak
5fa9344c8f Deactivated broken tests. 2016-10-06 13:43:05 +02:00
Armin Novak
9034867bb7 Added brush helper function to retrieve style. 2016-10-06 13:43:05 +02:00
Armin Novak
b505220328 Fixed Get/SetPixel function tests. 2016-10-06 13:43:05 +02:00
Armin Novak
d3538fc930 Fixed gdi LineTo and tests. 2016-10-06 13:43:04 +02:00
Armin Novak
35f1347d53 Fixed warnings and mac build. 2016-10-06 13:43:04 +02:00
Armin Novak
a06ceb6239 Fixed duplicate setting of callback. 2016-10-06 13:43:04 +02:00
Armin Novak
867528015a Simplified bitmap drawing. 2016-10-06 13:43:03 +02:00
Armin Novak
ec0d68bf4c Fixed bitmap update decoding. 2016-10-06 13:43:03 +02:00
Armin Novak
c22d16bc09 Reverted bitmap update changes. 2016-10-06 13:43:03 +02:00
Armin Novak
3898b56618 Fixed drawing orders. 2016-10-06 13:43:03 +02:00
Armin Novak
e3f88ad7ec Fixed BitBlt_PSDPxax 2016-10-06 13:43:03 +02:00
Armin Novak
032bdef955 Unified bitmap drawing. 2016-10-06 13:43:03 +02:00
Armin Novak
b8ff3cb235 Fixed (a lot of) GDI drawing issues. 2016-10-06 13:43:03 +02:00
Armin Novak
bb82d48506 Fixed part of font cache issue. 2016-10-06 13:43:03 +02:00
Armin Novak
3f90966da6 Bug fixes. 2016-10-06 13:43:03 +02:00
Armin Novak
85bbe2a908 API refactoring. 2016-10-06 13:43:03 +02:00
Armin Novak
f680b62d03 Fixed PATINVERT. 2016-10-06 13:43:02 +02:00
Armin Novak
e650fdb2b6 Bugfixes. 2016-10-06 13:43:02 +02:00
Armin Novak
17fd5526ac Cleanups. 2016-10-06 13:43:02 +02:00
Armin Novak
8b69b16cbb Refactored Glyph API. 2016-10-06 13:43:02 +02:00
Armin Novak
9d5ca34d0d Fixed pointer initialisation for X11. 2016-10-06 13:43:02 +02:00
Armin Novak
04fb4e4e4c Fixed rectangle clipping and warnings. 2016-10-06 13:43:02 +02:00
Armin Novak
c229a1939d Updated codec API, unified drawing order color decoding. 2016-10-06 13:43:02 +02:00
Armin Novak
6525a564f1 Fixed 24bit color format. 2016-10-06 13:43:01 +02:00
Armin Novak
39d6ad3acf Fixed source format for bitmap decompress. 2016-10-06 13:43:01 +02:00
Armin Novak
f9a89ae6b4 Bug fixes, refactoring. 2016-10-06 13:43:01 +02:00
Armin Novak
960bc26e9a Further refactored tests. 2016-10-06 13:43:01 +02:00
Armin Novak
9f0a9c3b92 Refactored GDI. 2016-10-06 13:43:01 +02:00
Armin Novak
c5b6e7e4ea Fixed GDI tests. 2016-10-06 13:43:01 +02:00
Armin Novak
8fffda5740 Fixed clearcodec and codecs reset. 2016-10-06 13:43:01 +02:00
Armin Novak
5e9c9f90ab Code refactoring. 2016-10-06 13:43:01 +02:00
Armin Novak
e6e8f2d4f2 Added ROP to string function. 2016-10-06 13:43:00 +02:00
Armin Novak
9fc8dc6b5d Removed gdi->codecs, unused. 2016-10-06 13:43:00 +02:00
Armin Novak
a6cef5cde7 Fixed GFX related issues. 2016-10-06 13:43:00 +02:00
Armin Novak
e860fde4bc Fixed function arguments. 2016-10-06 13:43:00 +02:00
Armin Novak
03907c82a9 Fixed issues. 2016-10-06 13:43:00 +02:00
Armin Novak
d98677094e Fixed warnings. 2016-10-06 13:43:00 +02:00
Armin Novak
bbae42d9c3 Compile fix 2016-10-06 13:43:00 +02:00
Armin Novak
5039a82d8b GDI fixes. 2016-10-06 13:43:00 +02:00
Armin Novak
e1c3adf61f freerdp_image_copy fixes, 8bit color improvements. 2016-10-06 13:42:59 +02:00
Armin Novak
716c5c53e9 256 color support. 2016-10-06 13:42:59 +02:00
Armin Novak
48d1b4ee13 Fixed color ordering for GDI. 2016-10-06 13:42:59 +02:00
Armin Novak
016f3a408b xxx. 2016-10-06 13:42:59 +02:00
Armin Novak
b668b0d75e Api update. 2016-10-06 13:42:59 +02:00
Armin Novak
0e7bb508c1 Bitmaps now remember their format. 2016-10-06 13:42:59 +02:00
Armin Novak
5633f5242a Fixed crashes. 2016-10-06 13:42:59 +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
zihao.jiang
e7d9e91864 channels/rdpgfx: Make freerdp_client_codecs_prepare calls codec reset. It fix broken h264 client from #3328. Also it doesn't make sense that we don't need width and height for codec initialization while we need them for codec reset 2016-05-30 02:00:05 +08:00
Marc-André Moreau
54cdd6a1ae channels/rdpgfx: fix resetting of codec contexts 2016-05-11 13:42:54 -04:00
Armin Novak
5bc333c626 Implemented GFX AVC444 support. 2016-03-16 13:43:18 +01:00
Armin Novak
3a3ec85898 Unified RDPGFX_RECT16 and RECTANGLE_16 2016-03-16 13:43:17 +01:00
Armin Novak
5bb68a0b39 Fixed broken resource cleanup. 2016-03-02 14:46:33 +01:00
Armin Novak
8997c6c03a Added log messages for unsupported surface commands. 2016-03-02 14:46:33 +01: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
93f3c060d2 Fixed memory overlap check. 2016-01-18 09:32:34 +01:00
Armin Novak
123cd523e0 Fixed SRCCOPY, using memmove now.
memcpy is not defined, if source and destination overlap.
2016-01-18 09:18:42 +01:00
Armin Novak
a0d6a1f77f Fixed memory leak. 2016-01-15 09:33:21 +01:00
Hardening
df81e842a5 Merge pull request #2932 from realjiangms/fix_gdi_brush
GDI: Fix usage of gdi_get_brush_pointer.
2015-12-18 10:50:51 +01:00
Bernhard Miklautz
7f7ef1a464 Merge pull request #2831 from akallabeth/gdi_fix
Fixed GDI_BITMAP, now using custom deallocation function.
2015-12-14 17:58:25 +01:00
Martin Fleisz
d0cda5a5c7 Merge pull request #2933 from realjiangms/fix_gdi_bitmap_update
GDI: Fix gdi_bitmap_update to check dest buffer size.
2015-10-20 08:44:52 +02:00
zihao.jiang
e8fb821be7 GDI: Fix gdi_bitmap_update to check dest buffer size. 2015-10-18 17:53:22 +08:00
zihao.jiang
83d58ccfe8 GDI: Fix usage of gdi_get_brush_pointer.
Currently we get color from brush according to the offset in the paint region.
According to MSDN https://msdn.microsoft.com/en-us/library/dd183396(v=vs.85).aspx, it should get color according to dest position instead of offset in paint region.
2015-10-17 02:49:45 +08:00
Marc-André Moreau
029cbf3aca libfreerdp-gdi: fix egfx multimon support 2015-10-13 15:50:39 -04:00
Armin Novak
551eca246b Ignoring H264 decompression failures.
When connecting to windows 8.1 machines the remote RDP server
implementation sometimes sends invalid H264 data. To avoid client
disconnections ignore the broken updates.
2015-09-03 12:11:15 +02:00
Martin Haimberger
52405a3e79 Remove WIN32ERROR type
All return values are UINT now.
2015-08-27 05:38:20 -07:00
Armin Novak
db3fa9a0d2 Added gdi_CreateBitmapEx function. 2015-08-26 12:14:46 +02:00
Armin Novak
e8554a51b8 Selecting correct bitmap in hdc now. 2015-08-12 12:53:35 +02:00
Armin Novak
8024a086cd Updated tests for new gdi_CreateBitmap API. 2015-08-12 11:15:07 +02:00
Armin Novak
253a60aaf3 Fixed GDI_BITMAP, now using custom deallocation function.
gdi_surface_bits: Now properly discarding old bitmap before creating a new one.
2015-08-12 11:01:05 +02:00
Martin Haimberger
6ab0187d84 Merge remote-tracking branch 'upstream/master' into mh-channel
Conflicts:
	channels/audin/client/oss/audin_oss.c
	channels/drive/client/drive_main.c
	channels/printer/client/printer_cups.c
	channels/printer/client/printer_main.c
	channels/rail/client/rail_main.c
	channels/rdpgfx/client/rdpgfx_main.c
	channels/rdpsnd/client/oss/rdpsnd_oss.c
	channels/remdesk/client/remdesk_main.c
	channels/remdesk/server/remdesk_main.c
	channels/tsmf/client/tsmf_media.c
2015-07-15 01:57:07 -07:00
Marc-André Moreau
cf2f4bf9cf Merge pull request #2737 from nfedera/nf-fix-gdi-return-value-weirdness
libfreerdp/gdi: fixed gdi return value madness
2015-06-26 09:24:08 -04: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
Norbert Federa
bb9536b867 libfreerdp/gdi: fixed gdi return value madness
Mostly booleanization to comply with the MS API
2015-06-26 14:32:38 +02:00
Giovanni Panozzo
8a45b567fc Returing OK when there is nothing to draw after clipping, fixes #2732 2015-06-25 16:54:08 +02:00
Armin Novak
6698e24228 Fixed leaks, NULL dereferences and broken init. 2015-06-23 21:29:21 +02:00
David FORT
7c3f8f33ab Fixes for malloc / calloc + other fixes
This patch contains:

* checks for malloc return value + treat callers;
* modified malloc() + ZeroMemory() to calloc();
* misc fixes of micro errors seen during the code audit:
** some invalid checks in gcc.c, also there were some possible
integer overflow. This is interesting because at the end the data are parsed
and freed directly, so it's a vulnerability in some kind of dead code (at least
useless);
** fixed usage of GetComputerNameExA with just one call, when 2 were used
in misc places. According to MSDN GetComputerNameA() is supposed to return
an error when called with NULL;
** there were a bug in the command line parsing of shadow;
** in freerdp_dynamic_channel_collection_add() the size of array was multiplied
by 4 instead of 2 on resize
2015-06-22 19:21:47 +02:00
Martin Haimberger
dc68bdfce5 channel rdpgfx hardend 2015-06-18 03:04:32 -07:00
Marc-André Moreau
29d14773c8 Merge branch 'master' of github.com:FreeRDP/FreeRDP
Conflicts:
	client/Windows/wf_client.c
	libfreerdp/common/assistance.c
2015-05-20 10:12:24 -04:00
Clive Stevens
5528b152ec Fix two cases of leaked regions in gdi/gfx 2015-05-20 12:35:24 +01:00
Norbert Federa
35c11c721e gdi: fix nullification of instance->context->cache 2015-05-14 20:33:21 +02:00
Norbert Federa
71a4349928 fixed multiple missing gdi return value checks
mainly gdi_Create* functions
2015-05-08 21:39:23 +02:00
Marc-André Moreau
30dd40e10a wfreerdp: fix and improve remote assistance 2015-05-07 14:20:49 -04: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
Bernhard Miklautz
ff11057d49 gdi: fix problem with gdi_SelectObject check(s)
When a hdc is created no initial or default objects are created
therefore can the first call of gdi_SelectObject return NULL.
Because of this checking the return value of  gdi_SelectObject failed
for newly create hdc causing errors (disconnects).

Since all types of HGDIOBJECT are handled and the return value of
gdi_SelectObject isn't used the recently added checks were removed
again.
2015-04-26 22:28: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
db81151ea4 gdi: fix broken return type checks
Integrates comments from pull request.
2015-04-21 14:18:07 +02:00
Bernhard Miklautz
2c072d33d3 Fix GDI return values and other fixes
* top level GDI functions return 0 on error and != 0 otherwise but the
  low level functions (16bpp.c, 8bpp.c 32bpp.c) which are called did it
	exactly the other way around. Those were adapted.
* change gdi_InvalidateRegion to BOOL and check calls where appropriate
* integrate comments from pull request
2015-04-21 14:18:07 +02:00