[WIP] Add some debug.

This commit is contained in:
Nick Couchman 2020-04-05 14:06:09 -04:00
parent 8d9d0fc097
commit 64a463738b
3 changed files with 12 additions and 4 deletions

View File

@ -36,8 +36,10 @@ void guac_rdpsnd_process_receive(guac_rdp_common_svc* svc,
guac_rdpsnd_pdu_header header; guac_rdpsnd_pdu_header header;
/* Check that we at least have a header. */ /* Check that we at least have a header. */
if (Stream_GetRemainingLength(input_stream) < sizeof(header)) if (Stream_GetRemainingLength(input_stream) < sizeof(header)) {
guac_client_log(svc->client, "Not enough bytes to process sound header.");
return; return;
}
/* Read RDPSND PDU header */ /* Read RDPSND PDU header */
Stream_Read_UINT8(input_stream, header.message_type); Stream_Read_UINT8(input_stream, header.message_type);
@ -45,8 +47,10 @@ void guac_rdpsnd_process_receive(guac_rdp_common_svc* svc,
Stream_Read_UINT16(input_stream, header.body_size); Stream_Read_UINT16(input_stream, header.body_size);
/* Check that the body_size actually exists in the input stream. */ /* Check that the body_size actually exists in the input stream. */
if (Stream_GetRemainingLength(input_stream) < header.body_size) if (Stream_GetRemainingLength(input_stream) < header.body_size) {
guac_client_log(svc->client, "Not enough bytes to process sound body.");
return; return;
}
/* /*
* If next PDU is SNDWAVE (due to receiving WaveInfo PDU previously), * If next PDU is SNDWAVE (due to receiving WaveInfo PDU previously),

View File

@ -267,8 +267,10 @@ void guac_rdp_ai_process_formats(guac_client* client,
Stream_Seek_UINT32(stream); /* cbSizeFormatsPacket (MUST BE IGNORED) */ Stream_Seek_UINT32(stream); /* cbSizeFormatsPacket (MUST BE IGNORED) */
/* Check amount of data. */ /* Check amount of data. */
if (Stream_GetRemainingLength(stream) < (8 + num_formats)) if (Stream_GetRemainingLength(stream) < (8 + num_formats)) {
guac_client_log(client, "Not enough bytes to process supported sound formats.");
return; return;
}
UINT32 index; UINT32 index;
for (index = 0; index < num_formats; index++) { for (index = 0; index < num_formats; index++) {

View File

@ -57,8 +57,10 @@ static void guac_rdp_ai_handle_data(guac_client* client,
Stream_Read_UINT8(stream, message_id); Stream_Read_UINT8(stream, message_id);
/* If not enough data, bail out. */ /* If not enough data, bail out. */
if (Stream_GetRemainingLength(stream) < 1) if (Stream_GetRemainingLength(stream) < 1) {
guac_client_log(client, "Not enough data in stream for incoming audio.");
return; return;
}
/* Invoke appropriate message processor based on ID */ /* Invoke appropriate message processor based on ID */
switch (message_id) { switch (message_id) {