From: Alexander Alekhin Date: Wed, 9 Jun 2021 07:31:38 +0000 (+0000) Subject: core: fix nSize initialization in cvIplImage() X-Git-Tag: submit/tizen/20220120.021815~1^2~1^2~19^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f80f43ff50cde29adee80f381046668c6a6707f;p=platform%2Fupstream%2Fopencv.git core: fix nSize initialization in cvIplImage() --- diff --git a/modules/core/include/opencv2/core/types_c.h b/modules/core/include/opencv2/core/types_c.h index eddbe7d664..fda0f05838 100644 --- a/modules/core/include/opencv2/core/types_c.h +++ b/modules/core/include/opencv2/core/types_c.h @@ -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 }