libragephoto: fix jpegSize not set to 0 when being cleared

This commit is contained in:
Syping 2025-11-10 20:03:45 +01:00
parent c8cd8112f0
commit b150959727
2 changed files with 2 additions and 0 deletions

View file

@ -1235,6 +1235,7 @@ bool ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t siz
else if (instance->data->jpeg) { else if (instance->data->jpeg) {
free(instance->data->jpeg); free(instance->data->jpeg);
instance->data->jpeg = NULL; instance->data->jpeg = NULL;
instance->data->jpegSize = 0;
} }
if (bufferSize != 0) { if (bufferSize != 0) {

View file

@ -1231,6 +1231,7 @@ bool RagePhoto::setJpeg(const char *data, uint32_t size, uint32_t bufferSize)
else if (m_data->jpeg) { else if (m_data->jpeg) {
free(m_data->jpeg); free(m_data->jpeg);
m_data->jpeg = nullptr; m_data->jpeg = nullptr;
m_data->jpegSize = 0;
} }
if (bufferSize != 0) { if (bufferSize != 0) {