aboutsummaryrefslogtreecommitdiff
path: root/backends/dc
diff options
context:
space:
mode:
authorMarcus Comstedt2003-03-07 15:19:07 +0000
committerMarcus Comstedt2003-03-07 15:19:07 +0000
commit69c51886cbab4c25e682ab0ea7346b2fdf43fb02 (patch)
tree4cdb5d4da26cb1e265ce4b62d5a4543fdf6b2b20 /backends/dc
parente7cb6ddb2e27610c5cca5fd9cfe3156a227555e4 (diff)
downloadscummvm-rg350-69c51886cbab4c25e682ab0ea7346b2fdf43fb02.tar.gz
scummvm-rg350-69c51886cbab4c25e682ab0ea7346b2fdf43fb02.tar.bz2
scummvm-rg350-69c51886cbab4c25e682ab0ea7346b2fdf43fb02.zip
Handle slightly broken icons (The Dig).
svn-id: r6742
Diffstat (limited to 'backends/dc')
-rw-r--r--backends/dc/icon.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/backends/dc/icon.cpp b/backends/dc/icon.cpp
index 93e70ad2b5..f1a33be31d 100644
--- a/backends/dc/icon.cpp
+++ b/backends/dc/icon.cpp
@@ -148,8 +148,11 @@ bool Icon::load_image2(void *data, int len)
if(!hdr.used)
hdr.used = 1<<hdr.bitcnt;
hdr.h >>= 1;
- if(hdr.size + (hdr.used<<2) + hdr.sizeimg > len ||
- hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3))
+ /* Fix incorrect sizeimg (The Dig) */
+ if(hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3))
+ hdr.sizeimg = ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3);
+ if(hdr.size + (hdr.used<<2) + hdr.sizeimg > len /* ||
+ hdr.sizeimg < ((hdr.w*hdr.h*(1+hdr.bitcnt)+7)>>3) */)
return false;
if(hdr.w != 32 || hdr.h != 32 || hdr.bitcnt != 4 || hdr.used > 16)
return false;