Fix format-detection by Robert Sanders
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@491 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
5d67a3e036
commit
9ba4716057
12
rdpsnd.c
12
rdpsnd.c
@ -104,6 +104,18 @@ rdpsnd_process_negotiate(STREAM in)
|
|||||||
in_uint16_le(in, format->wBitsPerSample);
|
in_uint16_le(in, format->wBitsPerSample);
|
||||||
in_uint16_le(in, format->cbSize);
|
in_uint16_le(in, format->cbSize);
|
||||||
|
|
||||||
|
/* read in the buffer of unknown use */
|
||||||
|
int readcnt = format->cbSize;
|
||||||
|
int discardcnt = 0;
|
||||||
|
if (format->cbSize > MAX_CBSIZE)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "cbSize too large for buffer: %d\n", format->cbSize);
|
||||||
|
readcnt = MAX_CBSIZE;
|
||||||
|
discardcnt = format->cbSize - MAX_CBSIZE;
|
||||||
|
}
|
||||||
|
in_uint8a(in, format->cb, readcnt);
|
||||||
|
in_uint8s(in, discardcnt);
|
||||||
|
|
||||||
if (device_available && wave_out_format_supported(format))
|
if (device_available && wave_out_format_supported(format))
|
||||||
{
|
{
|
||||||
format_count++;
|
format_count++;
|
||||||
|
3
types.h
3
types.h
@ -119,6 +119,8 @@ typedef struct _VCHANNEL
|
|||||||
}
|
}
|
||||||
VCHANNEL;
|
VCHANNEL;
|
||||||
|
|
||||||
|
#define MAX_CBSIZE 256
|
||||||
|
|
||||||
/* RDPSND */
|
/* RDPSND */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16 wFormatTag;
|
uint16 wFormatTag;
|
||||||
@ -128,6 +130,7 @@ typedef struct {
|
|||||||
uint16 nBlockAlign;
|
uint16 nBlockAlign;
|
||||||
uint16 wBitsPerSample;
|
uint16 wBitsPerSample;
|
||||||
uint16 cbSize;
|
uint16 cbSize;
|
||||||
|
uint8 cb[MAX_CBSIZE];
|
||||||
} WAVEFORMATEX;
|
} WAVEFORMATEX;
|
||||||
|
|
||||||
/* RDPDR */
|
/* RDPDR */
|
||||||
|
Loading…
Reference in New Issue
Block a user