Bug 876878: Avoid null deref if camera doesn't update framelist ptr r=bas

This commit is contained in:
Randell Jesup 2013-07-25 15:30:46 -04:00
parent b9c3f59eda
commit 1a83b7de43

View File

@ -586,7 +586,7 @@ int32_t DeviceInfoDS::CreateCapabilityMap(
if (hrVC == S_OK)
{
LONGLONG *frameDurationList;
LONGLONG *frameDurationList = NULL;
LONGLONG maxFPS;
long listSize;
SIZE size;
@ -605,7 +605,9 @@ int32_t DeviceInfoDS::CreateCapabilityMap(
// On some odd cameras, you may get a 0 for duration.
// GetMaxOfFrameArray returns the lowest duration (highest FPS)
if (hrVC == S_OK && listSize > 0 &&
// Initialize and check the returned list for null since
// some broken drivers don't modify it.
if (hrVC == S_OK && listSize > 0 && frameDurationList &&
0 != (maxFPS = GetMaxOfFrameArray(frameDurationList,
listSize)))
{