title: munmap_chunk(): invalid pointer error using opencv cv::Ptr
body: <p>I'm writing my first opencv code(and first C++ code actually), and met with a strange <code>munmap_chunk(): invalid pointer</code> error when I try to use cv::Ptr. I see in other posts that this usually results from freeing a already freed area, but I think I didn't.</p>
  
  <p>The following simple testing function will generate that error.</p>
  
  <pre><code>void testing(void) {
      int i=2;
      Ptr&lt; Mat &gt; pointer=new Mat[i];
  }
  </code></pre>
  
  <p>From the debugger, it seems that the destructor triggers the error when the function returns.I couldn't figure out why since basically I did nothing with the Ptr. So why this is happening and what's the correct usage?</p>
  
  <p>Thanks in advance.</p>