X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/30984deafc05d7c6f88db736336fe73d23a08e19..ca13514849bc5017c025094b7254aab6c87dda87:/src/common/gifdecod.cpp?ds=inline diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp index c9cfe9b16e..f49f473d3b 100644 --- a/src/common/gifdecod.cpp +++ b/src/common/gifdecod.cpp @@ -271,17 +271,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; } @@ -752,7 +754,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 */