1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-12-27 11:50:13 +00:00

ScreenGrab: Minor code-review fix

This commit is contained in:
walbourn_cp 2014-04-02 11:39:33 -07:00
parent c671cc3911
commit b2f914f26d

View File

@ -760,7 +760,7 @@ HRESULT DirectX::SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext,
*reinterpret_cast<uint32_t*>(&fileHeader[0]) = DDS_MAGIC; *reinterpret_cast<uint32_t*>(&fileHeader[0]) = DDS_MAGIC;
auto header = reinterpret_cast<DDS_HEADER*>( reinterpret_cast<uint8_t*>(&fileHeader[0]) + sizeof(uint32_t) ); auto header = reinterpret_cast<DDS_HEADER*>( &fileHeader[0] + sizeof(uint32_t) );
size_t headerSize = sizeof(uint32_t) + sizeof(DDS_HEADER); size_t headerSize = sizeof(uint32_t) + sizeof(DDS_HEADER);
memset( header, 0, sizeof(DDS_HEADER) ); memset( header, 0, sizeof(DDS_HEADER) );
header->size = sizeof( DDS_HEADER ); header->size = sizeof( DDS_HEADER );
@ -839,7 +839,7 @@ HRESULT DirectX::SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext,
} }
// Setup pixels // Setup pixels
std::unique_ptr<uint8_t> pixels( new (std::nothrow) uint8_t[ slicePitch ] ); std::unique_ptr<uint8_t[]> pixels( new (std::nothrow) uint8_t[ slicePitch ] );
if (!pixels) if (!pixels)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;