core: fix nSize initialization in cvIplImage()
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Wed, 9 Jun 2021 07:31:38 +0000 (07:31 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Wed, 9 Jun 2021 07:31:38 +0000 (07:31 +0000)
modules/core/include/opencv2/core/types_c.h

index eddbe7d..fda0f05 100644 (file)
@@ -358,7 +358,11 @@ _IplImage
                                needed for correct deallocation */
 
 #if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)
-    _IplImage() {}
+    _IplImage()
+    {
+        memset(this, 0, sizeof(*this));  // valid for POD structure
+        nSize = sizeof(IplImage);
+    }
     _IplImage(const cv::Mat& m) { *this = cvIplImage(m); }
 #endif
 }