X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa24cfa09d64817ed42618ad77eabf3478225697..e319bb30f7e88242f56144fcc279b57047566a6b:/src/common/gifdecod.cpp diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp index e520174b4d..3ca73d91a6 100644 --- a/src/common/gifdecod.cpp +++ b/src/common/gifdecod.cpp @@ -630,7 +630,7 @@ wxGIFErrorCode wxGIFDecoder::LoadGIF(wxInputStream& stream) m_szAnimation.SetWidth( buf[0] + 256 * buf[1] ); m_szAnimation.SetHeight( buf[2] + 256 * buf[3] ); - if ((m_szAnimation.GetWidth() == 0) || (m_szAnimation.GetHeight() == 0)) + if (anim && ((m_szAnimation.GetWidth() == 0) || (m_szAnimation.GetHeight() == 0))) { return wxGIF_INVFORMAT; } @@ -755,8 +755,8 @@ wxGIFErrorCode wxGIFDecoder::LoadGIF(wxInputStream& stream) pimg->w = buf[4] + 256 * buf[5]; pimg->h = buf[6] + 256 * buf[7]; - if ((pimg->w == 0) || (pimg->w > (unsigned int)m_szAnimation.GetWidth()) || - (pimg->h == 0) || (pimg->h > (unsigned int)m_szAnimation.GetHeight())) + if (anim && ((pimg->w == 0) || (pimg->w > (unsigned int)m_szAnimation.GetWidth()) || + (pimg->h == 0) || (pimg->h > (unsigned int)m_szAnimation.GetHeight()))) { Destroy(); return wxGIF_INVFORMAT; @@ -869,7 +869,6 @@ wxGIFErrorCode wxGIFDecoder::LoadGIF(wxInputStream& stream) if ((buf[8] & 0x80) == 0x80) { unsigned int local_ncolors = 2 << (buf[8] & 0x07); - wxFileOffset pos = stream.TellI(); wxFileOffset numBytes = 3 * local_ncolors; stream.SeekI(numBytes, wxFromCurrent); }