summaryrefslogtreecommitdiff
path: root/avstream/avscamera/sys/Device.cpp
diff options
context:
space:
mode:
authorWei Mao <[email protected]>2017-03-20 18:25:57 -0700
committerWei Mao <[email protected]>2017-03-20 18:27:00 -0700
commite044ea456aad4c444fbce00a2d9b56b304d59884 (patch)
tree4326af385f0666a3af0b7dfae534db68e3e25785 /avstream/avscamera/sys/Device.cpp
parentbc6e698503f46afbd8fcf62f6d3939147dc49999 (diff)
parente4581d8cd1bcc5108786b082a1ec24007a508847 (diff)
Merge pull request #118 from saredd/master
Diffstat (limited to 'avstream/avscamera/sys/Device.cpp')
-rw-r--r--avstream/avscamera/sys/Device.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/avstream/avscamera/sys/Device.cpp b/avstream/avscamera/sys/Device.cpp
index 107cdafc..1b5f8090 100644
--- a/avstream/avscamera/sys/Device.cpp
+++ b/avstream/avscamera/sys/Device.cpp
@@ -700,7 +700,7 @@ Return Value:
// Publish our profile here.
uiProfileCount = InitializeDeviceProfiles(fFrontCamera, &pDeviceProfiles);
- if( uiProfileCount > 0 )
+ if( uiProfileCount > 0 && pDeviceProfiles != nullptr)
{
if( NT_SUCCESS(KsInitializeDeviceProfile(FilterFactory)) )
{
@@ -721,6 +721,10 @@ Return Value:
ExFreePool(pDeviceProfiles);
pDeviceProfiles = NULL;
}
+ else
+ {
+ IFFAILED_EXIT(STATUS_INSUFFICIENT_RESOURCES);
+ }
}
// On a real device this object would be constructed whenever the sensor hardware is ready...