]> git.saurik.com Git - wxWidgets.git/commitdiff
If the GIF isn't an animation, we can ignore the animation size, thus
authorJulian Smart <julian@anthemion.co.uk>
Thu, 2 Nov 2006 22:00:21 +0000 (22:00 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 2 Nov 2006 22:00:21 +0000 (22:00 +0000)
suppressing false error.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42965 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/gifdecod.cpp

index 0b53e9c627d29b16323fd77c1123d6549d5df699..3ca73d91a6ce0df85062050b4f8714d7cc2e49df 100644 (file)
@@ -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;