1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

fix static analysis issues

This commit is contained in:
Alexander Alekhin
2019-03-13 17:14:03 +03:00
parent 61eb1a6848
commit 8c8715c4dd
3 changed files with 7 additions and 2 deletions
+2
View File
@@ -4435,6 +4435,7 @@ public:
: size_(size), originPtr_(ptr), alignment_(alignment), ptr_(ptr), allocatedPtr_(NULL)
{
CV_DbgAssert((alignment & (alignment - 1)) == 0); // check for 2^n
CV_DbgAssert(!readAccess || ptr);
if (((size_t)ptr_ & (alignment - 1)) != 0)
{
allocatedPtr_ = new uchar[size_ + alignment - 1];
@@ -4488,6 +4489,7 @@ public:
: size_(rows*step), originPtr_(ptr), alignment_(alignment), ptr_(ptr), allocatedPtr_(NULL), rows_(rows), cols_(cols), step_(step)
{
CV_DbgAssert((alignment & (alignment - 1)) == 0); // check for 2^n
CV_DbgAssert(!readAccess || ptr != NULL);
if (ptr == 0 || ((size_t)ptr_ & (alignment - 1)) != 0)
{
allocatedPtr_ = new uchar[size_ + extrabytes + alignment - 1];