|
From: Yoda-JM <yo...@us...> - 2010-01-07 00:05:02
|
Module: performous
Branch: master
Commit: 83b454af6300e8c55b57cf09b846f18ad61cd2d4
Author: Vincent Le Ligeour <yo...@us...>
Date: Thu Jan 7 01:04:41 2010 +0100
Tried to fix jpeg loading problem
---
game/image.hh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/image.hh b/game/image.hh
index 2002e3a..0527a00 100644
--- a/game/image.hh
+++ b/game/image.hh
@@ -98,7 +98,7 @@ template <typename T> void loadJPEG(T& target, std::string const& filename) {
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
jpeg_stdio_src(&cinfo, infile);
- jpeg_read_header(&cinfo, true);
+ if( jpeg_read_header(&cinfo, true) != JPEG_HEADER_OK) throw std::runtime_error("Cannot read header of " + filename);
jpeg_start_decompress(&cinfo);
unsigned w = cinfo.output_width;
unsigned h = cinfo.output_height;
|