RagePhoto: avoid setData() replacing it's own RagePhotoData

This commit is contained in:
Syping 2023-01-08 18:34:47 +01:00
parent 96eae4f957
commit 1173db1aa8

View file

@ -939,6 +939,9 @@ inline void RagePhoto::setBufferOffsets(RagePhotoData *ragePhotoData)
bool RagePhoto::setData(RagePhotoData *ragePhotoData, bool takeOwnership) bool RagePhoto::setData(RagePhotoData *ragePhotoData, bool takeOwnership)
{ {
if (m_data == ragePhotoData)
return true;
if (takeOwnership) { if (takeOwnership) {
std::free(m_data->jpeg); std::free(m_data->jpeg);
std::free(m_data->description); std::free(m_data->description);