X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7ac31c429f668e236f4d9686c47b5172f625781c..98cb8dcb0cf3b0e660f1f67e1c02451ab10257de:/src/common/gifdecod.cpp diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp index 732557ca3b..5d9b295a6e 100644 --- a/src/common/gifdecod.cpp +++ b/src/common/gifdecod.cpp @@ -8,10 +8,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "gifdecod.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -271,17 +267,19 @@ bool wxGIFDecoder::GoPrevFrame(bool cyclic) bool wxGIFDecoder::GoFrame(int which) { - int i; - if (!IsAnimation()) return false; if ((which >= 1) && (which <= m_nimages)) { + m_image = 1; m_pimage = m_pfirst; - for (i = 0; i < which; i++) + while (m_image < which) + { + m_image++; m_pimage = m_pimage->next; + } return true; } @@ -507,7 +505,7 @@ int wxGIFDecoder::dgif(GIFImage *img, int interl, int bits) /* loop until a valid y coordinate has been found, Or if the maximum number of passes has been reached, exit the loop, and stop image - decoding (At this point the image is succesfully + decoding (At this point the image is successfully decoded). If we don't loop, but merely set y to some other value, that new value might still be invalid depending @@ -621,7 +619,7 @@ bool wxGIFDecoder::CanRead() if ( !m_f->Read(buf, WXSIZEOF(buf)) ) return false; - m_f->SeekI(-(off_t)WXSIZEOF(buf), wxFromCurrent); + m_f->SeekI(-(wxFileOffset)WXSIZEOF(buf), wxFromCurrent); return memcmp(buf, "GIF", WXSIZEOF(buf)) == 0; } @@ -752,7 +750,7 @@ int wxGIFDecoder::ReadGIF() transparent = buf[4]; /* read disposal method */ - disposal = (buf[1] & 0x1C) - 1; + disposal = ((buf[1] & 0x1C) >> 2) - 1; } else /* other extension, skip */