Index: fpdfsdk/src/fpdfview.cpp |
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp |
index af24e71b941c4fef170cc81d39a449821d07ae73..23d44935b544743727e3f6dd80f2d7c4c391d791 100644 |
--- a/fpdfsdk/src/fpdfview.cpp |
+++ b/fpdfsdk/src/fpdfview.cpp |
@@ -299,14 +299,16 @@ public: |
virtual FX_FILESIZE GetSize() {return m_size;} |
virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) |
{ |
- if (offset < 0) { |
- return FALSE; |
- } |
- FX_SAFE_FILESIZE newPos = base::checked_cast<FX_FILESIZE, size_t>(size); |
- newPos += offset; |
- if (!newPos.IsValid() || newPos.ValueOrDie() > (FX_DWORD)m_size) return FALSE; |
- FXSYS_memcpy(buffer, m_pBuf+offset, size); |
- return TRUE; |
+ if (offset < 0) { |
+ return FALSE; |
+ } |
+ FX_SAFE_FILESIZE newPos = base::checked_cast<FX_FILESIZE, size_t>(size); |
+ newPos += offset; |
+ if (!newPos.IsValid() || newPos.ValueOrDie() > (FX_DWORD)m_size) { |
+ return FALSE; |
+ } |
+ FXSYS_memcpy(buffer, m_pBuf+offset, size); |
+ return TRUE; |
} |
private: |
FX_BYTE* m_pBuf; |