From 326a3c6bdc5cfeda1b1d52d004a473ec30e1e7b6 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 13 Apr 2012 19:07:41 -0700 Subject: [PATCH] mux: ensure # images = # tiles when a file contains tiles an image outside of a tile is not allowed. Change-Id: I5d16759abc9aa9bb299103b2cd7d694fc9c89697 --- src/mux/muxinternal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mux/muxinternal.c b/src/mux/muxinternal.c index e9a3be95..ae66e3f0 100644 --- a/src/mux/muxinternal.c +++ b/src/mux/muxinternal.c @@ -540,6 +540,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; }