Description

In GPUSkinCache, based on the conditional expression:

if (CacheCurrentFloatOffset + NumRWFloats > (uint32)GGPUSkinCacheBufferSize)
	{
		// Can't fit this
		INC_DWORD_STAT(STAT_GPUSkinCache_SkippedForMemory);
		return -1;
	}

the licensee is stating that it is possible for skinning to execute even though there is no space the result.

They suggest replacing the code with:

 if ((CacheCurrentFloatOffset + NumRWFloats) * sizeof(float) > SkinCacheBuffer[UAVIndex].NumBytes)
Steps to Reproduce
  1. Open UE4.sln
  2. Navigate to GPUSkinCache.cpp line 485
  3. Notice the conditional expression:
    if (CacheCurrentFloatOffset + NumRWFloats > (uint32)GGPUSkinCacheBufferSize)
    	{
    		// Can't fit this
    		INC_DWORD_STAT(STAT_GPUSkinCache_SkippedForMemory);
    		return -1;
    	}
  4. The licensee suggests replacing the expression with:
     if ((CacheCurrentFloatOffset + NumRWFloats) * sizeof(float) > SkinCacheBuffer[UAVIndex].NumBytes)

Result: The licensee suggests this code would prevent the buffer overrun.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-38321 in the post.

1
Login to Vote

Cannot Reproduce
ComponentUE - Graphics Features
Affects Versions4.124.134.14
Target Fix4.22
CreatedNov 7, 2016
ResolvedDec 10, 2018
UpdatedJan 31, 2019