]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/anidecod.cpp
Return NULL from wxWindow::GetCapture() when the capture is being lost.
[wxWidgets.git] / src / common / anidecod.cpp
index 9d202672c66e6dd3f5c190c4830a221ed3542763..d62c00b45535a92df7101c14aa72b02364975d94 100644 (file)
@@ -2,7 +2,6 @@
 // Name:        src/common/anidecod.cpp
 // Purpose:     wxANIDecoder, ANI reader for wxImage and wxAnimation
 // Author:      Francesco Montorsi
-// RCS-ID:      $Id$
 // Copyright:   (c) Francesco Montorsi
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -127,6 +126,11 @@ bool wxANIDecoder::DoCanRead(wxInputStream& stream) const
     wxInt32 anih32;
     memcpy( &anih32, "anih", 4 );
 
+    if ( stream.IsSeekable() && stream.SeekI(0) == wxInvalidOffset )
+    {
+        return false;
+    }
+
     if ( !stream.Read(&FCC1, 4) )
         return false;
 
@@ -220,6 +224,11 @@ bool wxANIDecoder::Load( wxInputStream& stream )
     wxInt32 seq32;
     memcpy( &seq32, "seq ", 4 );
 
+    if ( stream.IsSeekable() && stream.SeekI(0) == wxInvalidOffset )
+    {
+        return false;
+    }
+
     if ( !stream.Read(&FCC1, 4) )
         return false;
     if ( FCC1 != riff32 )