X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/952ae1e88b9092f493b4ea6911a2b60b378d422d..aad65f130d9cb77d0e9f2b7b580c54712386f77a:/src/common/imagpcx.cpp diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp index 2e50e2c5a5..64a4d246b0 100644 --- a/src/common/imagpcx.cpp +++ b/src/common/imagpcx.cpp @@ -486,13 +486,12 @@ bool wxPCXHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos bool wxPCXHandler::DoCanRead( wxInputStream& stream ) { - unsigned char c; - - c = stream.GetC(); - stream.SeekI(-1, wxFromCurrent); + unsigned char c = stream.GetC(); + if ( !stream ) + return FALSE; // not very safe, but this is all we can get from PCX header :-( - return (c == 10); + return c == 10; } #endif // wxUSE_STREAMS && wxUSE_PCX