tsmf: fix invalid check and a potential segfault

This resuscitates tsmf which was accidently broken in commit f8120919
This commit is contained in:
Norbert Federa 2015-05-28 10:49:38 +02:00
parent a2e0746f15
commit 8e70012d65
1 changed files with 4 additions and 2 deletions

View File

@ -288,8 +288,7 @@ TSMF_PRESENTATION* tsmf_presentation_new(const BYTE* guid, IWTSVirtualChannelCal
CopyMemory(presentation->presentation_id, guid, GUID_SIZE);
presentation->channel_callback = pChannelCallback;
presentation->volume = 5000; /* 50% */
presentation->stream_list = ArrayList_New(TRUE);
if (presentation->stream_list)
if (!(presentation->stream_list = ArrayList_New(TRUE)))
goto error_stream_list;
ArrayList_Object(presentation->stream_list)->fnObjectFree = (OBJECT_FREE_FN) _tsmf_stream_free;
@ -829,6 +828,9 @@ void tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation,
TSMF_STREAM* stream;
void *tmp_rects;
if (num_rects < 1 || !rects)
return;
/* The server may send messages with invalid width / height.
* Ignore those messages. */
if (!width || !height)