mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
WebPMuxGetChunk: add an assert
assert idx != IDX_LAST_CHUNK to quiet a static analysis warning (reported by Coverity): overrun-local: Overrunning array kChunks of 11 12-byte elements at element index 11 (byte offset 143) using index idx (which evaluates to 11). Change-Id: I85ae159e338d5670c007f76277ffe94e7a1dcafc
This commit is contained in:
parent
955a3d14ae
commit
3c0011bbd1
@ -432,6 +432,7 @@ WebPMuxError WebPMuxGetChunk(const WebPMux* mux, const char fourcc[4],
|
||||
return WEBP_MUX_INVALID_ARGUMENT;
|
||||
}
|
||||
idx = ChunkGetIndexFromFourCC(fourcc);
|
||||
assert(idx != IDX_LAST_CHUNK);
|
||||
if (IsWPI(kChunks[idx].id)) { // An image chunk.
|
||||
return WEBP_MUX_INVALID_ARGUMENT;
|
||||
} else if (idx != IDX_UNKNOWN) { // A known chunk type.
|
||||
|
Loading…
Reference in New Issue
Block a user