aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2024-03-20 12:36:37 -0700
committerJames Zern <jzern@google.com>2024-03-20 12:36:37 -0700
commit00abc0007c1228994fec2902ceb3ff3552d1bff6 (patch)
tree3ab2e50cb8ac188bb2dce5f8a30088b98590a42c
parent1bf46358c44be405f006b13cf4fecb15ab5131b2 (diff)
downloadwebp-00abc0007c1228994fec2902ceb3ff3552d1bff6.tar.gz
muxread,MuxGet: add an assert
assert idx != IDX_LAST_CHUNK to quiet a static analysis warning (reported by Coverity): Indexing array kChunks of size 11 with idx. Change-Id: I5e54b5c09d23c26abbd1a7919b6f828b35fe4f75
-rw-r--r--src/mux/muxread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mux/muxread.c b/src/mux/muxread.c
index 37ddd901..64df1659 100644
--- a/src/mux/muxread.c
+++ b/src/mux/muxread.c
@@ -37,6 +37,7 @@
static WebPMuxError MuxGet(const WebPMux* const mux, CHUNK_INDEX idx,
uint32_t nth, WebPData* const data) {
assert(mux != NULL);
+ assert(idx != IDX_LAST_CHUNK);
assert(!IsWPI(kChunks[idx].id));
WebPDataInit(data);