mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-18 23:09:52 +02:00
Support for unknown chunks in mux library
WebPMuxSetChunk/WebPMuxGetChunk/WebPMuxDeleteChunk now correctly handle unknown chunks. Change-Id: I2b75106ef08260f2bce03eb1782924b620643746
This commit is contained in:
@ -237,7 +237,6 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data,
|
||||
if (wpi->is_partial_) goto Err; // Encountered a non-image chunk before
|
||||
// getting all chunks of an image.
|
||||
chunk_list = MuxGetChunkListFromId(mux, id); // List to add this chunk.
|
||||
if (chunk_list == NULL) chunk_list = &mux->unknown_;
|
||||
if (ChunkSetNth(&chunk, chunk_list, 0) != WEBP_MUX_OK) goto Err;
|
||||
break;
|
||||
}
|
||||
@ -502,12 +501,8 @@ WebPMuxError WebPMuxNumChunks(const WebPMux* mux,
|
||||
*num_elements = MuxImageCount(mux->images_, id);
|
||||
} else {
|
||||
WebPChunk* const* chunk_list = MuxGetChunkListFromId(mux, id);
|
||||
if (chunk_list == NULL) {
|
||||
*num_elements = 0;
|
||||
} else {
|
||||
const CHUNK_INDEX idx = ChunkGetIndexFromId(id);
|
||||
*num_elements = CountChunks(*chunk_list, kChunks[idx].tag);
|
||||
}
|
||||
const CHUNK_INDEX idx = ChunkGetIndexFromId(id);
|
||||
*num_elements = CountChunks(*chunk_list, kChunks[idx].tag);
|
||||
}
|
||||
|
||||
return WEBP_MUX_OK;
|
||||
|
Reference in New Issue
Block a user