From b1509597271e5373a19f477f4f3d487527b9c777 Mon Sep 17 00:00:00 2001 From: Syping Date: Mon, 10 Nov 2025 20:03:45 +0100 Subject: [PATCH] libragephoto: fix jpegSize not set to 0 when being cleared --- src/core/RagePhoto.c | 1 + src/core/RagePhoto.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/core/RagePhoto.c b/src/core/RagePhoto.c index 659a192..f3da886 100644 --- a/src/core/RagePhoto.c +++ b/src/core/RagePhoto.c @@ -1235,6 +1235,7 @@ bool ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t siz else if (instance->data->jpeg) { free(instance->data->jpeg); instance->data->jpeg = NULL; + instance->data->jpegSize = 0; } if (bufferSize != 0) { diff --git a/src/core/RagePhoto.cpp b/src/core/RagePhoto.cpp index 5dbdd98..345836a 100644 --- a/src/core/RagePhoto.cpp +++ b/src/core/RagePhoto.cpp @@ -1231,6 +1231,7 @@ bool RagePhoto::setJpeg(const char *data, uint32_t size, uint32_t bufferSize) else if (m_data->jpeg) { free(m_data->jpeg); m_data->jpeg = nullptr; + m_data->jpegSize = 0; } if (bufferSize != 0) {