1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04: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:
Alexander Smorkalov
2025-03-14 09:01:15 +03:00
committed by GitHub
+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;