mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-16 13:59:51 +02:00
Mux: Allow only some frames/tiles to have alpha.
And related const fixes. Change-Id: I79f6f1b9f8c6faac8cc4ef24b58edff6d90de045
This commit is contained in:
@ -262,9 +262,9 @@ WebPMuxImage* MuxImageRelease(WebPMuxImage* const wpi) {
|
||||
//------------------------------------------------------------------------------
|
||||
// MuxImage search methods.
|
||||
|
||||
int MuxImageCount(WebPMuxImage* const wpi_list, WebPChunkId id) {
|
||||
int MuxImageCount(const WebPMuxImage* wpi_list, WebPChunkId id) {
|
||||
int count = 0;
|
||||
WebPMuxImage* current;
|
||||
const WebPMuxImage* current;
|
||||
for (current = wpi_list; current != NULL; current = current->next_) {
|
||||
const WebPChunk* const wpi_chunk = *MuxImageGetListFromId(current, id);
|
||||
if (wpi_chunk != NULL) {
|
||||
@ -558,13 +558,6 @@ WebPMuxError MuxValidate(const WebPMux* const mux) {
|
||||
} else {
|
||||
err = ValidateChunk(mux, IDX_ALPHA, ALPHA_FLAG, flags, -1, &num_alpha);
|
||||
if (err != WEBP_MUX_OK) return err;
|
||||
|
||||
// num_images & num_alpha_chunks are consistent.
|
||||
if (num_alpha > 0 && num_alpha != num_images) {
|
||||
// Note that "num_alpha > 0" is the correct test but "flags && ALPHA_FLAG"
|
||||
// is NOT, because ALPHA_FLAG is based on first image only.
|
||||
return WEBP_MUX_INVALID_ARGUMENT;
|
||||
}
|
||||
}
|
||||
|
||||
// num_tiles & num_images are consistent.
|
||||
|
Reference in New Issue
Block a user