do not crash for missing images

This commit is contained in:
Konstantin Käfer
2014-10-29 16:09:42 -04:00
parent 414ccaaf93
commit 7a13db9a86
3 changed files with 5 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ public:
inline const char *getData() const { return img.get(); }
inline uint32_t getWidth() const { return width; }
inline uint32_t getHeight() const { return height; }
inline operator bool() const { return img && width && height; }
private:
// loaded image dimensions
@@ -24,7 +25,6 @@ private:
// the raw image data
std::unique_ptr<char[]> img;
};