summaryrefslogtreecommitdiffstats
path: root/ue2/imgsynth2/cwindowsbitmap.cpp
diff options
context:
space:
mode:
authormanuel <manuel@nc8430.lan>2009-05-02 17:28:21 +0200
committermanuel <manuel@nc8430.lan>2009-05-02 17:28:21 +0200
commit5c4506a8c5ee1a82268146007619b09e980a7a57 (patch)
treec21bb83bdf7c87b7c9f9693cd4fcd43212ae4be2 /ue2/imgsynth2/cwindowsbitmap.cpp
parentbcadfa267f976fe9f29afa50a635cbe3ea174e38 (diff)
downloadooprog-5c4506a8c5ee1a82268146007619b09e980a7a57.tar.gz
ooprog-5c4506a8c5ee1a82268146007619b09e980a7a57.tar.bz2
ooprog-5c4506a8c5ee1a82268146007619b09e980a7a57.zip
add some assert() to make tutor happy
Diffstat (limited to 'ue2/imgsynth2/cwindowsbitmap.cpp')
-rw-r--r--ue2/imgsynth2/cwindowsbitmap.cpp2
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 }