mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
Fix incorrect Mat address reconstruction on 64-bit platforms
This fixes random failures in Java wrappers.
This commit is contained in:
parent
c49b23d4dd
commit
bf3c2b0bbb
@ -219,7 +219,7 @@ void Mat_to_vector_Mat(cv::Mat& mat, std::vector<cv::Mat>& v_mat)
|
||||
for(int i=0; i<mat.rows; i++)
|
||||
{
|
||||
Vec<int, 2> a = mat.at< Vec<int, 2> >(i, 0);
|
||||
long long addr = (((long long)a[0])<<32) | a[1];
|
||||
long long addr = (((long long)a[0])<<32) | (a[1]&0xffffffff);
|
||||
Mat& m = *( (Mat*) addr );
|
||||
v_mat.push_back(m);
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ public class Converters {
|
||||
int[] buff = new int[count * 2];
|
||||
m.get(0, 0, buff);
|
||||
for (int i = 0; i < count; i++) {
|
||||
long addr = (((long) buff[i * 2]) << 32) | ((long) buff[i * 2 + 1]);
|
||||
long addr = (((long) buff[i * 2]) << 32) | (((long) buff[i * 2 + 1]) & 0xffffffffL);
|
||||
mats.add(new Mat(addr));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user