mirror of
https://github.com/webmproject/libwebp.git
synced 2025-08-29 07:12:05 +02:00
misc fixes in libwebpmux
* Assert chunklist * fix potential memory leak and * fix null pointer access There should not be several alpha_ or img_ chunks in SynthesizeBitstream. Use ChunkListDelete in MuxImageRelease to be safe. A null pointer accessed in WebPMuxPushFrame triggered a harmless runtime error. Change-Id: I3027f8752093652bd41f55e667d041c0de77ab6e
This commit is contained in:
@@ -227,9 +227,11 @@ void MuxImageInit(WebPMuxImage* const wpi) {
|
||||
WebPMuxImage* MuxImageRelease(WebPMuxImage* const wpi) {
|
||||
WebPMuxImage* next;
|
||||
if (wpi == NULL) return NULL;
|
||||
ChunkDelete(wpi->header_);
|
||||
ChunkDelete(wpi->alpha_);
|
||||
ChunkDelete(wpi->img_);
|
||||
// There should be at most one chunk of header_, alpha_, img_ but we call
|
||||
// ChunkListDelete to be safe
|
||||
ChunkListDelete(&wpi->header_);
|
||||
ChunkListDelete(&wpi->alpha_);
|
||||
ChunkListDelete(&wpi->img_);
|
||||
ChunkListDelete(&wpi->unknown_);
|
||||
|
||||
next = wpi->next_;
|
||||
|
Reference in New Issue
Block a user