X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8898456df4728afe7d100011e0e23b0ffb9a6341..36f93678223be23747d90a393c9ba6c7cbe351c0:/src/common/imagiff.cpp diff --git a/src/common/imagiff.cpp b/src/common/imagiff.cpp index 311fcadfbb..058d6e5cd0 100644 --- a/src/common/imagiff.cpp +++ b/src/common/imagiff.cpp @@ -379,22 +379,15 @@ int wxIFFDecoder::ReadIFF() // main decoding loop. searches IFF chunks and handles them. // terminates when BODY chunk was found or dataptr ran over end of file // - bool BMHDok = false, CMAPok = false, CAMGok = false; + bool BMHDok = false, CAMGok = false; int bmhd_width = 0, bmhd_height = 0, bmhd_bitplanes = 0, bmhd_transcol = -1; - byte bmhd_masking = 0, bmhd_compression = 0; + byte bmhd_compression = 0; long camg_viewmode = 0; int colors = 0; while (dataptr + 8 <= dataend) { // get chunk length and make even - size_t chunkLen = (iff_getlong(dataptr + 4) + 1) & 0xfffffffe; -#ifdef __VMS - // Silence compiler warning - int chunkLen_; - chunkLen_ = chunkLen; - if (chunkLen_ < 0) { // format error? -#else - if (chunkLen < 0) { // format error? -#endif + long chunkLen = (iff_getlong(dataptr + 4) + 1) & 0xfffffffe; + if (chunkLen < 0) { // format error? break; } bool truncated = (dataptr + 8 + chunkLen > dataend); @@ -406,7 +399,7 @@ int wxIFFDecoder::ReadIFF() bmhd_width = iff_getword(dataptr + 8); // width of picture bmhd_height= iff_getword(dataptr + 8 + 2); // height of picture bmhd_bitplanes = *(dataptr + 8 + 8); // # of bitplanes - bmhd_masking = *(dataptr + 8 + 9); + // bmhd_masking = *(dataptr + 8 + 9); -- unused currently bmhd_compression = *(dataptr + 8 + 10); // get compression bmhd_transcol = iff_getword(dataptr + 8 + 12); BMHDok = true; // got BMHD @@ -440,7 +433,6 @@ int wxIFFDecoder::ReadIFF() wxLogTrace(_T("iff"), _T("Read %d colors from IFF file."), colors); - CMAPok = true; // got CMAP dataptr += 8 + chunkLen; // to next chunk } else if (strncmp((char *)dataptr, "CAMG", 4) == 0) { // CAMG ? if (chunkLen < 4 || truncated) {