From b5b96a841ce1e4796223d81e25e9fcd5dafb9d88 Mon Sep 17 00:00:00 2001 From: Syping Date: Wed, 20 Oct 2021 09:24:48 +0200 Subject: [PATCH] fix setPhoto() photoSize not being updated --- src/RagePhoto.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/RagePhoto.cpp b/src/RagePhoto.cpp index e8c9142..1c2aeee 100644 --- a/src/RagePhoto.cpp +++ b/src/RagePhoto.cpp @@ -737,6 +737,7 @@ bool RagePhoto::setPhoto(const char *data, uint32_t size, uint32_t bufferSize) } p_photoData = t_photoData; memcpy(p_photoData, data, size); + p_photoSize = size; } else if (p_photoSize < size) { free(p_photoData); @@ -747,6 +748,7 @@ bool RagePhoto::setPhoto(const char *data, uint32_t size, uint32_t bufferSize) return false; } memcpy(p_photoData, data, size); + p_photoSize = size; } else { memcpy(p_photoData, data, size); @@ -760,6 +762,7 @@ bool RagePhoto::setPhoto(const char *data, uint32_t size, uint32_t bufferSize) } memcpy(p_photoData, data, size); p_photoLoaded = true; + p_photoSize = size; } if (bufferSize != 0) {