Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit1d701d1

Browse files
authored
Merge pull request#26776 from vrabaud:ub_warp
Don't overflow pointer addition
2 parents796adf5 +e76924e commit1d701d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎modules/imgproc/src/imgwarp.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ static void remapBicubic( const Mat& _src, Mat& _dst, const Mat& _xy,
955955
sum += S[0]*w[8] + S[cn]*w[9] + S[cn*2]*w[10] + S[cn*3]*w[11];
956956
S += sstep;
957957
sum += S[0]*w[12] + S[cn]*w[13] + S[cn*2]*w[14] + S[cn*3]*w[15];
958-
S+=1 -sstep*3;
958+
S-=sstep *3 -1;
959959
D[k] =castOp(sum);
960960
}
961961
}
@@ -988,9 +988,9 @@ static void remapBicubic( const Mat& _src, Mat& _dst, const Mat& _xy,
988988
for(int i =0; i <4; i++, w +=4 )
989989
{
990990
int yi = y[i];
991-
const T* S = S0 + yi*sstep;
992991
if( yi <0 )
993992
continue;
993+
const T* S = S0 + yi*sstep;
994994
if( x[0] >=0 )
995995
sum += (S[x[0]] - cv)*w[0];
996996
if( x[1] >=0 )

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp