Doesn't reset the stream pos to 0 in CanRead().
Please note that the PCX handler still cannot read images embedded in streams because it has to check for some things at the END of the file before proceeding! git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -266,12 +266,9 @@ bool wxPCXHandler::SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(
|
|||||||
bool wxPCXHandler::DoCanRead( wxInputStream& stream )
|
bool wxPCXHandler::DoCanRead( wxInputStream& stream )
|
||||||
{
|
{
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
off_t pos;
|
|
||||||
|
|
||||||
pos = stream.TellI();
|
|
||||||
stream.SeekI(0, wxFromStart);
|
|
||||||
c = stream.GetC();
|
c = stream.GetC();
|
||||||
stream.SeekI(pos, wxFromStart);
|
stream.SeekI(-1, wxFromCurrent);
|
||||||
|
|
||||||
// not very safe, but this is all we can get from PCX header :-(
|
// not very safe, but this is all we can get from PCX header :-(
|
||||||
return (c == 10);
|
return (c == 10);
|
||||||
|
Reference in New Issue
Block a user