1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Move the CV_Assert above the << operation to not trigger the fuzzer

This commit is contained in:
Vincent Rabaud
2025-03-13 09:59:09 +01:00
parent e30697fd42
commit 186537a315
+1 -1
View File
@@ -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;