summaryrefslogtreecommitdiff
path: root/avstream/avscamera/sys/Capture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'avstream/avscamera/sys/Capture.cpp')
-rw-r--r--avstream/avscamera/sys/Capture.cpp19
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;