Do not update stream->pos when seeking is failed.

This commit is contained in:
Akira TAGOH 2012-02-22 16:50:13 +09:00
parent 71b14d645f
commit 5e4ea1104c
1 changed files with 2 additions and 1 deletions

View File

@ -82,7 +82,6 @@ ftglue_stream_seek( FT_Stream stream,
{
FT_Error error = 0;
stream->pos = pos;
if ( stream->read )
{
if ( stream->read( stream, pos, 0, 0 ) )
@ -91,6 +90,8 @@ ftglue_stream_seek( FT_Stream stream,
else if ( pos > stream->size )
error = FT_Err_Invalid_Stream_Operation;
if ( !error )
stream->pos = pos;
LOG(( "ftglue:stream:seek(%ld) -> %d\n", pos, error ));
return error;
}