mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
Merge pull request #27047 from vrabaud:lzw
Move the CV_Assert above the << operation to not trigger the fuzzer
This commit is contained in:
commit
14396b8029
@ -319,9 +319,9 @@ bool GifDecoder::lzwDecode() {
|
||||
lzwMinCodeSize = m_strm.getByte();
|
||||
const int lzwMaxSize = (1 << 12); // 4096 is the maximum size of the LZW table (12 bits)
|
||||
int lzwCodeSize = lzwMinCodeSize + 1;
|
||||
CV_Assert(lzwCodeSize > 2 && lzwCodeSize <= 12);
|
||||
int clearCode = 1 << lzwMinCodeSize;
|
||||
int exitCode = clearCode + 1;
|
||||
CV_Assert(lzwCodeSize > 2 && lzwCodeSize <= 12);
|
||||
std::vector<lzwNodeD> lzwExtraTable(lzwMaxSize + 1);
|
||||
int colorTableSize = clearCode;
|
||||
int lzwTableSize = exitCode;
|
||||
|
Loading…
Reference in New Issue
Block a user