[Fontconfig] [PATCH] Update stream position after seeking is done

Akira TAGOH akira at tagoh.org
Wed Feb 22 00:02:45 PST 2012


Thanks for reminding me. changed like FT_Stream_Seek deals with.

BTW I think posting patches here would be a good idea to make the code
visible for reviews though, it's a bit hard to keep it on track.
particularly there are no time to have a look at it. so I'd recommend
to file a bug to bugzilla too.
I'm also pondering to change the initial bug owner to the list (maybe
a separate list like fontconfig-bugs?) and open to watch bugs if one
prefer :)

On Wed, Feb 22, 2012 at 4:36 PM, Jjgod Jiang <gzjjgod at gmail.com> wrote:
> Hi Akira,
>
> Any chance of getting this patch in? Thanks.
>
> ---------- Forwarded message ----------
> From: Jiang Jiang <gzjjgod at gmail.com>
> Date: Tue, Nov 29, 2011 at 11:56 AM
> Subject: [PATCH] Update stream position after seeking is done
> To: fontconfig at lists.freedesktop.org
> Cc: Jiang Jiang <jiang.jiang at nokia.com>
>
>
> From: Jiang Jiang <jiang.jiang at nokia.com>
>
> In stream->read function there will be check like if (stream->pos !=
> pos) then fseek(...), so if stream->pos is set to pos before read then
> the seek may never happen.
> ---
>  src/ftglue.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/ftglue.c b/src/ftglue.c
> index d5af810..b9e2129 100644
> --- a/src/ftglue.c
> +++ b/src/ftglue.c
> @@ -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,7 @@ ftglue_stream_seek( FT_Stream   stream,
>   else if ( pos > stream->size )
>     error = FT_Err_Invalid_Stream_Operation;
>
> +  stream->pos = pos;
>   LOG(( "ftglue:stream:seek(%ld) -> %d\n", pos, error ));
>   return error;
>  }
> --
> 1.7.4.1



-- 
Akira TAGOH


More information about the Fontconfig mailing list