mirror of
https://github.com/webmproject/libwebp.git
synced 2025-08-31 08:12:09 +02:00
mux: plug some memory leaks on error
Make sure chunk->data and wpi are not leaked by MuxAddFrameTileInternal() in case of MEMORY_ERROR in ChunkSetNth(). Change-Id: Ie20e84b92f4bdcb7c3b94520f36b20dd2e730545
This commit is contained in:
@@ -47,8 +47,7 @@ void ChunkInit(WebPChunk* const chunk) {
|
||||
chunk->next_ = NULL;
|
||||
}
|
||||
|
||||
// Releases chunk and returns chunk->next_.
|
||||
static WebPChunk* ChunkRelease(WebPChunk* const chunk) {
|
||||
WebPChunk* ChunkRelease(WebPChunk* const chunk) {
|
||||
WebPChunk* next;
|
||||
if (chunk == NULL) return NULL;
|
||||
free(chunk->image_info_);
|
||||
@@ -239,7 +238,7 @@ void MuxImageInit(WebPMuxImage* const wpi) {
|
||||
wpi->next_ = NULL;
|
||||
}
|
||||
|
||||
static WebPMuxImage* MuxImageRelease(WebPMuxImage* const wpi) {
|
||||
WebPMuxImage* MuxImageRelease(WebPMuxImage* const wpi) {
|
||||
WebPMuxImage* next;
|
||||
if (wpi == NULL) return NULL;
|
||||
ChunkDelete(wpi->header_);
|
||||
|
Reference in New Issue
Block a user