From e0ae21d2317688e25add3b47f0fd692b45656135 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 28 Mar 2025 12:37:24 -0700 Subject: [PATCH] WebPMemoryWriterClear: use WebPMemoryWriterInit Removes some common code between the two functions. Change-Id: If9f42e580e34dad63f3806750d9d7571941026b5 --- src/enc/picture_enc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/enc/picture_enc.c b/src/enc/picture_enc.c index 5a270354..d4c8917a 100644 --- a/src/enc/picture_enc.c +++ b/src/enc/picture_enc.c @@ -226,9 +226,7 @@ int WebPMemoryWrite(const uint8_t* data, size_t data_size, void WebPMemoryWriterClear(WebPMemoryWriter* writer) { if (writer != NULL) { WebPSafeFree(writer->mem); - writer->mem = NULL; - writer->size = 0; - writer->max_size = 0; + WebPMemoryWriterInit(writer); } }