Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 186537a

Browse filesBrowse files
committed
Move the CV_Assert above the << operation to not trigger the fuzzer
1 parent e30697f commit 186537a
Copy full SHA for 186537a

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎modules/imgcodecs/src/grfmt_gif.cpp

Copy file name to clipboardExpand all lines: modules/imgcodecs/src/grfmt_gif.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ bool GifDecoder::lzwDecode() {
319319
lzwMinCodeSize = m_strm.getByte();
320320
const int lzwMaxSize = (1 << 12); // 4096 is the maximum size of the LZW table (12 bits)
321321
int lzwCodeSize = lzwMinCodeSize + 1;
322+
CV_Assert(lzwCodeSize > 2 && lzwCodeSize <= 12);
322323
int clearCode = 1 << lzwMinCodeSize;
323324
int exitCode = clearCode + 1;
324-
CV_Assert(lzwCodeSize > 2 && lzwCodeSize <= 12);
325325
std::vector<lzwNodeD> lzwExtraTable(lzwMaxSize + 1);
326326
int colorTableSize = clearCode;
327327
int lzwTableSize = exitCode;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.