Skip to content

Commit ae151ac

Browse files
DataBlobImpl: return null data ptr when the blob is empty
1 parent 2ba1c40 commit ae151ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Common/src/DataBlobImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ size_t DataBlobImpl::GetSize() const
9797
/// Returns the pointer to the internal data buffer
9898
void* DataBlobImpl::GetDataPtr(size_t Offset)
9999
{
100-
return &m_DataBuff[Offset];
100+
return !m_DataBuff.empty() ? &m_DataBuff[Offset] : nullptr;
101101
}
102102

103103
/// Returns const pointer to the internal data buffer
104104
const void* DataBlobImpl::GetConstDataPtr(size_t Offset) const
105105
{
106-
return &m_DataBuff[Offset];
106+
return !m_DataBuff.empty() ? &m_DataBuff[Offset] : nullptr;
107107
}
108108

109109
IMPLEMENT_QUERY_INTERFACE(DataBlobImpl, IID_DataBlob, TBase)

0 commit comments

Comments
 (0)