Bug 1219501. In imagelib, initialize the number of cores to at least 1 in case of error. r=seth

PR_GetNumberOfProcessors returns -1 in case of error, which is MAXUINT32 when turned into an unsigned int like sNumCores.
This commit is contained in:
Timothy Nikkel 2015-11-01 11:45:40 -06:00
parent c2d043f6d7
commit 362307b1a3

View File

@ -302,7 +302,7 @@ private:
DecodePool::Initialize()
{
MOZ_ASSERT(NS_IsMainThread());
sNumCores = PR_GetNumberOfProcessors();
sNumCores = max<int32_t>(PR_GetNumberOfProcessors(), 1);
DecodePool::Singleton();
}