mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 02:15:42 +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:
		| @@ -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. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user