title: findContours gives memory heap error
body: <p>I have following picture and try to find the largest rectangle with OpenCV with these lines</p>
  
  <pre><code>std::vector&lt; std::vector&lt;cv::Point&gt; &gt; contours;
  cv::findContours(result,contours,CV_RETR_LIST,CV_CHAIN_APPROX_SIMPLE);
  </code></pre>
  
  <p>But the statements above causes memory heap error. Can anyone give me a clue why this is happening? I have been stretching my hairs for last couple of hours.</p>
  
  <p>I think it's something to do with cv::Point allocator since call stack indicates it.</p>
  
  <p><strong>Update:</strong> I just ran the program with CvFindContours instead without any problem. So it must be OpenCV 2.3.1.</p>
  
  <p><strong>Update2:</strong> Thanks to @karlphillip answer, I revisited my project and it was my Visual Studio project setting. I was linking MFC as static library because of annoying memork leak message. That was the cause of the problem. When I use MFC as shared DLL, the problem went away.</p>
  
  <p><img src="https://i.stack.imgur.com/sWe7e.jpg" alt="enter image description here"></p>