diff --git a/modules/hdf/src/hdf5.cpp b/modules/hdf/src/hdf5.cpp index 7f13398f7..1886574e3 100644 --- a/modules/hdf/src/hdf5.cpp +++ b/modules/hdf/src/hdf5.cpp @@ -433,8 +433,8 @@ void HDF5Impl::dscreate( const int rows, const int cols, const int type, String dslabel, const int compresslevel, const vector& dims_chunks ) const { - CV_Assert( &dims_chunks[0] == NULL || dims_chunks.size() == 2 ); - dscreate( rows, cols, type, dslabel, compresslevel, &dims_chunks[0] ); + CV_Assert( dims_chunks.empty() || dims_chunks.size() == 2 ); + dscreate( rows, cols, type, dslabel, compresslevel, dims_chunks.empty() ? NULL : &(dims_chunks[0]) ); } void HDF5Impl::dscreate( const int rows, const int cols, const int type, @@ -466,10 +466,10 @@ void HDF5Impl::dscreate( const vector& sizes, const int type, String dslabel, const int compresslevel, const vector& dims_chunks ) const { - CV_Assert( &dims_chunks[0] == NULL || dims_chunks.size() == sizes.size() ); + CV_Assert( dims_chunks.empty() || dims_chunks.size() == sizes.size() ); const int n_dims = (int) sizes.size(); - dscreate( n_dims, &sizes[0], type, dslabel, compresslevel, &dims_chunks[0] ); + dscreate( n_dims, &sizes[0], type, dslabel, compresslevel, dims_chunks.empty() ? NULL : &(dims_chunks[0]) ); } void HDF5Impl::dscreate( const int n_dims, const int* sizes, const int type, diff --git a/modules/xfeatures2d/src/pct_signatures/grayscale_bitmap.cpp b/modules/xfeatures2d/src/pct_signatures/grayscale_bitmap.cpp index d4062ba6d..0ed6a7632 100644 --- a/modules/xfeatures2d/src/pct_signatures/grayscale_bitmap.cpp +++ b/modules/xfeatures2d/src/pct_signatures/grayscale_bitmap.cpp @@ -110,7 +110,7 @@ namespace cv } } // Prepare the preallocated contrast matrix for contrast-entropy computations - mCoOccurrenceMatrix.resize(1 << (mBitsPerPixel * 2)); // mCoOccurrenceMatrix size = maxPixelValue^2 + mCoOccurrenceMatrix.resize((int)(1 << (mBitsPerPixel * 2))); // mCoOccurrenceMatrix size = maxPixelValue^2 }