summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cv2pdb.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cv2pdb.cpp b/src/cv2pdb.cpp
index 9b7edbf..0562278 100644
--- a/src/cv2pdb.cpp
+++ b/src/cv2pdb.cpp
@@ -167,10 +167,10 @@ bool CV2PDB::openPDB(const TCHAR* pdbname, const TCHAR* pdbref)
#endif
rsdsLen = 24 + strlen(pdbnameA) + 1; // sizeof(OMFSignatureRSDS) without name
- // Growing the RSDS block to the closest 16-byte boundary.
- if (rsdsLen & 0xF)
- rsdsLen = (rsdsLen | 0xF) + 1;
+ // Growing the RSDS block to the closest 16-byte boundary to align the debug directory.
+ rsdsLen = (rsdsLen + 0xf) & ~0xf;
rsds = (OMFSignatureRSDS *) new char[rsdsLen];
+ memset(rsds, 0, rsdslen);
memcpy (rsds->Signature, "RSDS", 4);
pdb->QuerySignature2(&rsds->guid);
rsds->age = pdb->QueryAge();