X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8faef7ccbc4b4e192da06de7e1a2a7f1dff7ec91..b404a8f3b072129c107c6d9a5e0f6f53cd34807b:/src/common/anidecod.cpp?ds=sidebyside diff --git a/src/common/anidecod.cpp b/src/common/anidecod.cpp index 9d202672c6..d0d0b6d75b 100644 --- a/src/common/anidecod.cpp +++ b/src/common/anidecod.cpp @@ -127,6 +127,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 +225,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 )