WebPMemoryWriterClear: use WebPMemoryWriterInit

Removes some common code between the two functions.

Change-Id: If9f42e580e34dad63f3806750d9d7571941026b5
This commit is contained in:
James Zern 2025-03-28 12:37:24 -07:00
parent a4183d94c7
commit e0ae21d231

View File

@ -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);
}
}