Ask Your Question

roboto1986's profile - activity

2012-08-27 19:35:14 -0600 commented answer Editing core.hpp crashes during run-time

Thank you both for taking the time to look over this. So to summarize, and please correct me if I'm wrong, OpenCV copies only the x and y data to mat.data from _Point so later on because I added my variable, the bytes don't align any more and I basically over-run my iterator's pointer? So this was more of an experiment than a barrier to what I'm going to do but it's always nice to know why things break the way they do :)

2012-08-27 19:29:12 -0600 received badge  Scholar (source)
2012-08-26 20:20:55 -0600 asked a question Editing core.hpp crashes during run-time

So I asked a question on StackOverflow and was wondering if anyone came across this. My program works fine until I add an un-initialized member variable to Point_ class defined in core.hpp. When compiled, this variable wont be initialized and will contain a random variable and will be 4 bytes larger than the original. Why is assigning a vector of that type to another vector of the same type make the iterator crash with: "Debug Assertion Failed!" "Expression: vector iterator not dereferencable"

What made the iterator 'not dereferencable' when adding this un-initialized variable?

Thanks!