From: Vadim Zeitlin Date: Thu, 21 Feb 2002 15:19:25 +0000 (+0000) Subject: fixes for big endiand machines (Chris Elliott, patch 520879) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1af5934b54a758ad09bd17c13f0d3d2a38d16a77 fixes for big endiand machines (Chris Elliott, patch 520879) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 3dcd8b1254..f8552ff5a5 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -1255,7 +1255,7 @@ bool wxANIHandler::LoadFile(wxImage *image, wxInputStream& stream, { // we always have a data size stream.Read(&datalen, 4); - + datalen = wxINT32_SWAP_ON_BE(datalen) ; //now either data or a FCC if ( (FCC1 == *riff32) || (FCC1 == *list32) ) { @@ -1301,11 +1301,11 @@ bool wxANIHandler::DoCanRead(wxInputStream& stream) // we have a riff file: while ( stream.IsOk() ) { - if ( FCC1 != *anih32 ) + if ( FCC1 == *anih32 ) return TRUE; // we always have a data size: stream.Read(&datalen, 4); - + datalen = wxINT32_SWAP_ON_BE(datalen) ; // now either data or a FCC: if ( (FCC1 == *riff32) || (FCC1 == *list32) ) { @@ -1345,7 +1345,7 @@ int wxANIHandler::GetImageCount(wxInputStream& stream) { // we always have a data size: stream.Read(&datalen, 4); - + datalen = wxINT32_SWAP_ON_BE(datalen) ; // now either data or a FCC: if ( (FCC1 == *riff32) || (FCC1 == *list32) ) { @@ -1357,7 +1357,7 @@ int wxANIHandler::GetImageCount(wxInputStream& stream) { wxUint32 *pData = new wxUint32[datalen/4]; stream.Read(pData, datalen); - int nIcons = *(pData + 1); + int nIcons = wxINT32_SWAP_ON_BE(*(pData + 1)); delete[] pData; return nIcons; }