GUACAMOLE-1059: Merge explicit non-fatal check for invalid RDP audio format request.

This commit is contained in:
Mike Jumper 2020-05-25 02:41:51 -07:00 committed by GitHub
commit 8d895f13c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -296,11 +296,18 @@ void guac_rdpsnd_wave_info_handler(guac_rdp_common_svc* svc,
rdpsnd->next_pdu_is_wave = TRUE; rdpsnd->next_pdu_is_wave = TRUE;
/* Reset audio stream if format has changed */ /* Reset audio stream if format has changed */
if (audio != NULL) if (audio != NULL) {
guac_audio_stream_reset(audio, NULL, if (format < sizeof(rdpsnd->formats))
rdpsnd->formats[format].rate, guac_audio_stream_reset(audio, NULL,
rdpsnd->formats[format].channels, rdpsnd->formats[format].rate,
rdpsnd->formats[format].bps); rdpsnd->formats[format].channels,
rdpsnd->formats[format].bps);
else
guac_client_log(svc->client, GUAC_LOG_WARNING, "RDP server "
"attempted to specify an invalid audio format. Sound may "
"not work as expected.");
}
} }