mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
muxread,anmf: fail on multiple image chunks
treat an ANMF chunk containing multiple VP8/VP8L file as malformed. fixes a WebPMuxImage::img_ leak. Though the invalid free in #9106 was avoided in (ubsan):be738c6d
muxread,ChunkVerifyAndAssign: validate chunk_size that file would still cause a leak similar to #9099. BUG=oss-fuzz:9099,oss-fuzz:9106,webp:512 Change-Id: Ib873446a1188afeeb2fe5d53a86b75e0c5de9573 (cherry picked from commiteb82ce76dd
) (cherry picked from commitf4cf238a41
)
This commit is contained in:
parent
2ccbb406e1
commit
b5e0b231c1
@ -138,6 +138,7 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data,
|
||||
wpi->is_partial_ = 1; // Waiting for a VP8 chunk.
|
||||
break;
|
||||
case WEBP_CHUNK_IMAGE:
|
||||
if (wpi->img_ != NULL) goto Fail; // Only 1 image chunk allowed.
|
||||
if (ChunkSetNth(&subchunk, &wpi->img_, 1) != WEBP_MUX_OK) goto Fail;
|
||||
if (!MuxImageFinalize(wpi)) goto Fail;
|
||||
wpi->is_partial_ = 0; // wpi is completely filled.
|
||||
|
Loading…
Reference in New Issue
Block a user