diff options
| author | Sanjeev Reddy <[email protected]> | 2017-03-09 17:18:02 -0800 |
|---|---|---|
| committer | Sanjeev Reddy <[email protected]> | 2017-03-09 17:18:02 -0800 |
| commit | e4581d8cd1bcc5108786b082a1ec24007a508847 (patch) | |
| tree | 1f49cee3db80a5c7aa7e8c495bf0395ec459730c /AVStream/avscamera/sys/Capture.cpp | |
| parent | 1098c82e7d71d3f47157e0837cb939203f944939 (diff) | |
Fix OACR code analysis warnings
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; |
