diff options
| author | Wei Mao <[email protected]> | 2017-03-20 18:25:57 -0700 |
|---|---|---|
| committer | Wei Mao <[email protected]> | 2017-03-20 18:27:00 -0700 |
| commit | e044ea456aad4c444fbce00a2d9b56b304d59884 (patch) | |
| tree | 4326af385f0666a3af0b7dfae534db68e3e25785 /avstream/avscamera/sys/Capture.cpp | |
| parent | bc6e698503f46afbd8fcf62f6d3939147dc49999 (diff) | |
| parent | e4581d8cd1bcc5108786b082a1ec24007a508847 (diff) | |
Merge pull request #118 from saredd/master
Diffstat (limited to 'avstream/avscamera/sys/Capture.cpp')
| -rw-r--r-- | avstream/avscamera/sys/Capture.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/avstream/avscamera/sys/Capture.cpp b/avstream/avscamera/sys/Capture.cpp index 764052b3..cd62bae1 100644 --- a/avstream/avscamera/sys/Capture.cpp +++ b/avstream/avscamera/sys/Capture.cpp @@ -355,6 +355,11 @@ Return Value: // *m_pBitmapInfoHeader = m_VideoInfoHeader->bmiHeader; } + else + { + DBG_TRACE("Connection Format was invalid"); + return STATUS_INVALID_DEVICE_STATE; + } DBG_TRACE( "+++ AvgTimePerFrame = %lld +++", m_VideoInfoHeader->AvgTimePerFrame ); @@ -808,7 +813,7 @@ EmitMetadata( NTSTATUS CCapturePin:: CompleteMapping( - _In_ PKSSTREAM_POINTER Clone + _In_opt_ PKSSTREAM_POINTER Clone ) /*++ @@ -1173,8 +1178,8 @@ Return Value: // For debugging... UNICODE_STRING NewFormat; UNICODE_STRING RefFormat; - RtlStringFromGUID( Pin->ConnectionFormat->SubFormat, &NewFormat ); - RtlStringFromGUID( DataRange->SubFormat, &RefFormat ); + (void)RtlStringFromGUID( Pin->ConnectionFormat->SubFormat, &NewFormat ); + (void)RtlStringFromGUID( DataRange->SubFormat, &RefFormat ); if( IsEqualGUID( Pin->ConnectionFormat->Specifier, ImageInfoSpecifier ) && Pin->ConnectionFormat->FormatSize >= sizeof (KS_DATAFORMAT_IMAGEINFO) ) @@ -1569,6 +1574,14 @@ Return Value: } // + // May only be null for size queries + // + if (Data == nullptr) + { + return STATUS_INVALID_PARAMETER; + } + + // // Copy over the KSDATAFORMAT, followed by the actual VideoInfoHeader // *DataSize = DataFormatSize; |
