[wdmaudiodev] Re: KSPROPERTY_PIN_PROPOSEDATAFORMAT/SET is called with invalid data

  • From: "Matthew van Eerde" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "Matthew.van.Eerde" for DMARC)
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Wed, 6 Dec 2017 11:13:18 +0000

  *   What could be a reason



Dunno. Give me a dump file and I’ll tell you based on the stack. If it’s a 
Windows bug the stack will identify the culprit.



________________________________
From: wdmaudiodev-bounce@xxxxxxxxxxxxx <wdmaudiodev-bounce@xxxxxxxxxxxxx> on 
behalf of Eugene Muzychenko <reg.wad@xxxxxxxxxxxxxx>
Sent: Tuesday, December 5, 2017 7:14:22 PM
To: Tim Roberts
Subject: [wdmaudiodev] Re: KSPROPERTY_PIN_PROPOSEDATAFORMAT/SET is called with 
invalid data

Hello Tim,

when FormatSize is less than KSDATAFORMAT_WAVEFORMATEX, then it's
not a KSDATAFORMAT_WAVEFORMATEX, so there is no "associated"
WAVEFORMATEX structure.

But what could be a reason for such logic?
KSPROPERTY_PIN_PROPOSEDATAFORMAT is the specific "data format"
property request, not a wide-purpose, universal one. MS docs said that
property value is KSDATAFORMAT, there are no other value types.
Therefore, KSDATAFORMAT structure itself must always be valid.

In the described case, SampleSize value of 0x3a281610 looks incorrect.

Moreover, if MajorFormat is KSDATAFORMAT_TYPE_AUDIO, SubFormat is
KSDATAFORMAT_SUBTYPE_PCM and Specifier is
KSDATAFORMAT_SPECIFIER_WAVEFORMATEX (in the described case, they are),
the data following KSDATAFORMAT *must* be a valid WAVEFORMATEX
descriptor, and FormatSize *must* be at least 0x52 (sizeof
(KSDATAFORMAT_WAVEFORMATEX)).

Do you really think that such MajorFormat/SubFormat/Specifier
combination may represent a *valid* format descriptor (but not
WAVEFORMATEX) with FormatSize less than 0x52? If so, is such
possibility mentioned in the docs?

Regards,
Eugene

******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.wdmaudiodev.com%2F&data=02%7C01%7CMatthew.van.Eerde%40microsoft.com%7C0ce6a798eae7425c366d08d53c57e954%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636481270659876624&sdata=y0DI0G1TnVtuFBCrLVrw3Zn1ANOe2HHIEdpTg2JpsEc%3D&reserved=0

Other related posts: