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 555dac5

Browse filesBrowse files
Weverythingidealisms
authored andcommitted
Fix a possible infinite loop by incrementing one of the variables used in the loop conditional.
This was detected by Richard Trieu when compiling with clang.
1 parent 79deb35 commit 555dac5
Copy full SHA for 555dac5

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+1
-2
lines changed

‎src/_image.cpp

Copy file name to clipboardExpand all lines: src/_image.cpp
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,8 +1039,7 @@ _image_module::fromarray2(const Py::Tuple& args)
10391039
int rgba = A->dimensions[2] == 4;
10401040
double r, g, b, alpha;
10411041
const size_t N = imo->rowsIn * imo->colsIn;
1042-
size_t i = 0;
1043-
while (i < N)
1042+
for (size_t i = 0; i < N; ++i)
10441043
{
10451044
r = *(double *)(A->data++);
10461045
g = *(double *)(A->data++);

0 commit comments

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