From 5c4506a8c5ee1a82268146007619b09e980a7a57 Mon Sep 17 00:00:00 2001 From: manuel Date: Sat, 2 May 2009 17:28:21 +0200 Subject: add some assert() to make tutor happy --- ue2/imgsynth2/cpixelformat_bgr555.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ue2/imgsynth2/cpixelformat_bgr555.cpp') diff --git a/ue2/imgsynth2/cpixelformat_bgr555.cpp b/ue2/imgsynth2/cpixelformat_bgr555.cpp index 657c148..ba12cb5 100644 --- a/ue2/imgsynth2/cpixelformat_bgr555.cpp +++ b/ue2/imgsynth2/cpixelformat_bgr555.cpp @@ -7,6 +7,7 @@ */ #include +#include #include "cpixelformat_bgr555.h" #include "cbitmap.h" @@ -16,6 +17,7 @@ void CPixelFormat_BGR555::getPixel(RGBPIXEL& pixel, uint32_t x, uint32_t y) { if (m_bitmap->getPixelData() == NULL) throw PixelFormatError("No pixelbuffer allocated."); + assert(m_bitmap->getPixelDataSize() > 0); /* if the y-coordinates are mirrored */ if (m_bitmap->isMirrored()) @@ -39,6 +41,7 @@ void CPixelFormat_BGR555::setPixel(const RGBPIXEL& pixel, uint32_t x, uint32_t y { if (m_bitmap->getPixelData() == NULL) throw PixelFormatError("No pixelbuffer allocated."); + assert(m_bitmap->getPixelDataSize() > 0); /* if the y-coordinates are mirrored */ if (m_bitmap->isMirrored()) -- cgit v1.2.3