diff --git a/coding/file_reader.cpp b/coding/file_reader.cpp index 6a7d0231a4..e19920e255 100644 --- a/coding/file_reader.cpp +++ b/coding/file_reader.cpp @@ -128,14 +128,13 @@ void FileReader::CheckPosAndSize(uint64_t pos, uint64_t size) const { uint64_t const allSize1 = Size(); bool const ret1 = (pos + size <= allSize1); - ASSERT(ret1, (pos, size, allSize1)); + if (!ret1) + MYTHROW(Reader::SizeException, (pos, size, allSize1)); uint64_t const allSize2 = m_fileData->Size(); bool const ret2 = (m_offset + pos + size <= allSize2); - ASSERT(ret2, (m_offset, pos, size, allSize2)); - - if (!ret1 || !ret2) - MYTHROW(Reader::SizeException, (pos, size)); + if (!ret2) + MYTHROW(Reader::SizeException, (pos, size, allSize2)); } void FileReader::SetOffsetAndSize(uint64_t offset, uint64_t size)