[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45586] branches/tile/source/blender/ compositor/operations/COM_MovieDistortionOperation.h: TileBranch
Jeroen Bakker
j.bakker at atmind.nl
Fri Apr 13 08:45:30 CEST 2012
Revision: 45586
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45586
Author: jbakker
Date: 2012-04-13 06:45:29 +0000 (Fri, 13 Apr 2012)
Log Message:
-----------
TileBranch
* The distortion node could read from unassigned memory. This is solved by this commit
Modified Paths:
--------------
branches/tile/source/blender/compositor/operations/COM_MovieDistortionOperation.h
Modified: branches/tile/source/blender/compositor/operations/COM_MovieDistortionOperation.h
===================================================================
--- branches/tile/source/blender/compositor/operations/COM_MovieDistortionOperation.h 2012-04-13 06:33:59 UTC (rev 45585)
+++ branches/tile/source/blender/compositor/operations/COM_MovieDistortionOperation.h 2012-04-13 06:45:29 UTC (rev 45586)
@@ -63,24 +63,29 @@
}
void getUV(MovieTracking* trackingData, int x, int y, float *u, float*v) {
- int offset = y * this->width + x;
- int offset2 = offset*2;
- if (!bufferCalculated[offset]) {
- float in[2];
- float out[2];
- in[0] = x;
- in[1] = y;
- if (inverted) {
- BKE_tracking_invert_intrinsics(trackingData, in, out);
- } else {
- BKE_tracking_apply_intrinsics(trackingData, in, out);
+ if (x<0 || x >= this->width || y <0 || y >= this->height) {
+ *u = x;
+ *v = y;
+ } else {
+ int offset = y * this->width + x;
+ int offset2 = offset*2;
+ if (!bufferCalculated[offset]) {
+ float in[2];
+ float out[2];
+ in[0] = x;
+ in[1] = y;
+ if (inverted) {
+ BKE_tracking_invert_intrinsics(trackingData, in, out);
+ } else {
+ BKE_tracking_apply_intrinsics(trackingData, in, out);
+ }
+ buffer[offset2] = out[0];
+ buffer[offset2+1] = out[1];
+ bufferCalculated[offset] = 1;
}
- buffer[offset2] = out[0];
- buffer[offset2+1] = out[1];
- bufferCalculated[offset] = 1;
+ *u = buffer[offset2];
+ *v = buffer[offset2+1];
}
- *u = buffer[offset2];
- *v = buffer[offset2+1];
}
};
More information about the Bf-blender-cvs
mailing list