diff --git a/src/mux/muxinternal.c b/src/mux/muxinternal.c index 38618a41..107d3f15 100644 --- a/src/mux/muxinternal.c +++ b/src/mux/muxinternal.c @@ -541,6 +541,11 @@ WebPMuxError WebPMuxValidate(const WebPMux* const mux) { return WEBP_MUX_INVALID_ARGUMENT; } + // num_tiles & num_images are consistent. + if (num_tiles > 0 && num_images != num_tiles) { + return WEBP_MUX_INVALID_ARGUMENT; + } + return WEBP_MUX_OK; }