Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CDirect3DData::GetTransform (
- D3DTRANSFORMSTATETYPE dwRequestedMatrix,
- D3DMATRIX * pMatrixOut)
- {
- switch ( dwRequestedMatrix )
- {
- case D3DTS_VIEW:
- memcpy (pMatrixOut, &m_mViewMatrix, sizeof(D3DMATRIX));
- break;
- case D3DTS_PROJECTION:
- memcpy (pMatrixOut, &m_mProjMatrix, sizeof(D3DMATRIX));
- break;
- case D3DTS_WORLD:
- memcpy (pMatrixOut, &m_mWorldMatrix, sizeof(D3DMATRIX));
- break;
- default:
- // Zero out the structure for the user.
- memcpy (pMatrixOut, 0, sizeof(D3DMATRIX)); <<<<<<<<<<
- break;
- }
- ....
- }
- A Copy-Paste error. Most likely this is what should be written here: memset(pMatrixOut, 0, sizeof(D3DMATRIX));.
- This suspicious code was found in MTASA project by PVS-Studio static code analyzer.
- Warning message is:
- V575 The null pointer is passed into 'memcpy' function. Inspect the second argument. cdirect3ddata.cpp 80
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement