[opencv] 81/98: Backport of StereoBM uninitialized memory access problem fix from master branch
Mattia Rizzolo
mattia at debian.org
Tue Oct 4 17:51:29 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to annotated tag 2.4.13
in repository opencv.
commit 772d9689e9f162d1a514315bd4932a172c23b3ef
Author: Vitaly Tuzov <vitaly.tuzov at itseez.com>
Date: Tue Apr 12 17:27:16 2016 +0300
Backport of StereoBM uninitialized memory access problem fix from master branch
---
modules/calib3d/src/stereobm.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/calib3d/src/stereobm.cpp b/modules/calib3d/src/stereobm.cpp
index 07268b6..2c8e23f 100644
--- a/modules/calib3d/src/stereobm.cpp
+++ b/modules/calib3d/src/stereobm.cpp
@@ -344,7 +344,7 @@ static void findStereoCorrespondenceBM_SSE2( const Mat& left, const Mat& right,
{
hsad = hsad0 - dy0*ndisp; cbuf = cbuf0 + (x + wsz2 + 1)*cstep - dy0*ndisp;
lptr = lptr0 + MIN(MAX(x, -lofs), width-lofs-1) - dy0*sstep;
- rptr = rptr0 + MIN(MAX(x, -rofs), width-rofs-1) - dy0*sstep;
+ rptr = rptr0 + MIN(MAX(x, -rofs), width-rofs-ndisp) - dy0*sstep;
for( y = -dy0; y < height + dy1; y++, hsad += ndisp, cbuf += ndisp, lptr += sstep, rptr += sstep )
{
@@ -385,7 +385,7 @@ static void findStereoCorrespondenceBM_SSE2( const Mat& left, const Mat& right,
hsad = hsad0 - dy0*ndisp;
lptr_sub = lptr0 + MIN(MAX(x0, -lofs), width-1-lofs) - dy0*sstep;
lptr = lptr0 + MIN(MAX(x1, -lofs), width-1-lofs) - dy0*sstep;
- rptr = rptr0 + MIN(MAX(x1, -rofs), width1-1) - dy0*sstep;
+ rptr = rptr0 + MIN(MAX(x1, -rofs), width-ndisp-rofs) - dy0*sstep;
for( y = -dy0; y < height + dy1; y++, cbuf += ndisp, cbuf_sub += ndisp,
hsad += ndisp, lptr += sstep, lptr_sub += sstep, rptr += sstep )
@@ -610,7 +610,7 @@ findStereoCorrespondenceBM( const Mat& left, const Mat& right,
{
hsad = hsad0 - dy0*ndisp; cbuf = cbuf0 + (x + wsz2 + 1)*cstep - dy0*ndisp;
lptr = lptr0 + std::min(std::max(x, -lofs), width-lofs-1) - dy0*sstep;
- rptr = rptr0 + std::min(std::max(x, -rofs), width-rofs-1) - dy0*sstep;
+ rptr = rptr0 + std::min(std::max(x, -rofs), width-rofs-ndisp) - dy0*sstep;
for( y = -dy0; y < height + dy1; y++, hsad += ndisp, cbuf += ndisp, lptr += sstep, rptr += sstep )
{
@@ -661,7 +661,7 @@ findStereoCorrespondenceBM( const Mat& left, const Mat& right,
hsad = hsad0 - dy0*ndisp;
lptr_sub = lptr0 + MIN(MAX(x0, -lofs), width-1-lofs) - dy0*sstep;
lptr = lptr0 + MIN(MAX(x1, -lofs), width-1-lofs) - dy0*sstep;
- rptr = rptr0 + MIN(MAX(x1, -rofs), width1-1) - dy0*sstep;
+ rptr = rptr0 + MIN(MAX(x1, -rofs), width-ndisp-rofs) - dy0*sstep;
for( y = -dy0; y < height + dy1; y++, cbuf += ndisp, cbuf_sub += ndisp,
hsad += ndisp, lptr += sstep, lptr_sub += sstep, rptr += sstep )
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git
More information about the debian-science-commits
mailing list