diff --git a/modules/imgcodecs/src/bitstrm.cpp b/modules/imgcodecs/src/bitstrm.cpp index 12d9c1bcae..a7e6380dfb 100644 --- a/modules/imgcodecs/src/bitstrm.cpp +++ b/modules/imgcodecs/src/bitstrm.cpp @@ -153,7 +153,7 @@ void RBaseStream::setPos( int64_t pos ) int64_t RBaseStream::getPos() { CV_Assert(isOpened()); - int64_t pos = validateToInt64((m_current - m_start) + m_block_pos); + int64_t pos = static_cast((m_current - m_start) + m_block_pos); CV_Assert(pos >= m_block_pos); // overflow check CV_Assert(pos >= 0); // overflow check return pos; diff --git a/modules/imgcodecs/src/utils.cpp b/modules/imgcodecs/src/utils.cpp index cfbd62b7bc..41fd9f5041 100644 --- a/modules/imgcodecs/src/utils.cpp +++ b/modules/imgcodecs/src/utils.cpp @@ -51,13 +51,6 @@ int validateToInt(size_t sz) return valueInt; } -int64_t validateToInt64(ptrdiff_t sz) -{ - int64_t valueInt = static_cast(sz); - CV_Assert((ptrdiff_t)valueInt == sz); - return valueInt; -} - #define SCALE 14 #define cR (int)(0.299*(1 << SCALE) + 0.5) #define cG (int)(0.587*(1 << SCALE) + 0.5) diff --git a/modules/imgcodecs/src/utils.hpp b/modules/imgcodecs/src/utils.hpp index f2649f0ecd..95deebde31 100644 --- a/modules/imgcodecs/src/utils.hpp +++ b/modules/imgcodecs/src/utils.hpp @@ -45,7 +45,6 @@ namespace cv { int validateToInt(size_t step); -int64_t validateToInt64(ptrdiff_t step); template static inline size_t safeCastToSizeT(const _Tp v_origin, const char* msg)