mfreerdp-server: check for invalid rdpsnd format

This commit is contained in:
C-o-r-E 2013-03-05 17:31:31 -05:00
parent 0603f007bf
commit 8ab7ce23b5

View File

@ -263,12 +263,19 @@ static void rdpsnd_server_select_format(rdpsnd_server_context* context, int clie
printf("rdpsnd_server_select_format: index %d is not correct.\n", client_format_index);
return;
}
rdpsnd->src_bytes_per_sample = context->src_format.wBitsPerSample / 8;
rdpsnd->src_bytes_per_frame = rdpsnd->src_bytes_per_sample * context->src_format.nChannels;
context->selected_client_format = client_format_index;
format = &context->client_formats[client_format_index];
if (format->nSamplesPerSec == 0)
{
printf("Invalid Client Sound Format!!\n\n");
return;
}
if (format->wFormatTag == 0x11)
{