Welcome to mirror list, hosted at ThFree Co, Russian Federation.

high_distortion_crash_fix.patch « patches « libmv « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 54ab66fa27cd80dceac6bf3d9f717fa5c217e856 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/libmv/simple_pipeline/camera_intrinsics.cc b/src/libmv/simple_pipeline/camera_intrinsics.cc
index 4e88e1f..f9888ff 100644
--- a/src/libmv/simple_pipeline/camera_intrinsics.cc
+++ b/src/libmv/simple_pipeline/camera_intrinsics.cc
@@ -160,9 +160,13 @@ void CameraIntrinsics::ComputeLookupGrid(Offset* grid, int width, int height) {
       if( iy < 0 ) { iy = 0, fy = 0; }
       if( ix >= width-2 ) ix = width-2;
       if( iy >= height-2 ) iy = height-2;
-      //assert( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 );
-      Offset offset = { ix-x, iy-y, fx, fy };
-      grid[y*width+x] = offset;
+      if ( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 ) {
+        Offset offset = { ix-x, iy-y, fx, fy };
+        grid[y*width+x] = offset;
+      } else {
+        Offset offset = { 0, 0, 0, 0 };
+        grid[y*width+x] = offset;
+      }
     }
   }
 }