diff options
Diffstat (limited to 'ue2/imgsynth2/cwindowsbitmap.cpp')
| -rw-r--r-- | ue2/imgsynth2/cwindowsbitmap.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ue2/imgsynth2/cwindowsbitmap.cpp b/ue2/imgsynth2/cwindowsbitmap.cpp index d561465..83954b6 100644 --- a/ue2/imgsynth2/cwindowsbitmap.cpp +++ b/ue2/imgsynth2/cwindowsbitmap.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | #include <boost/lexical_cast.hpp> | 8 | #include <boost/lexical_cast.hpp> |
| 9 | #include <boost/numeric/conversion/cast.hpp> | 9 | #include <boost/numeric/conversion/cast.hpp> |
| 10 | #include <assert.h> | ||
| 10 | #ifdef DEBUG | 11 | #ifdef DEBUG |
| 11 | # include <iostream> | 12 | # include <iostream> |
| 12 | #endif | 13 | #endif |
| @@ -58,6 +59,7 @@ void CWindowsBitmap::read(std::ifstream& in) | |||
| 58 | if (m_pixeldata != NULL) | 59 | if (m_pixeldata != NULL) |
| 59 | delete[] m_pixeldata; | 60 | delete[] m_pixeldata; |
| 60 | m_pixeldata = new uint8_t[m_infoheader.biSizeImage]; | 61 | m_pixeldata = new uint8_t[m_infoheader.biSizeImage]; |
| 62 | assert(m_fileheader.bfOffBits > 0); | ||
| 61 | in.seekg(m_fileheader.bfOffBits); | 63 | in.seekg(m_fileheader.bfOffBits); |
| 62 | in.read(reinterpret_cast<char *>(m_pixeldata), m_infoheader.biSizeImage); | 64 | in.read(reinterpret_cast<char *>(m_pixeldata), m_infoheader.biSizeImage); |
| 63 | } | 65 | } |
