[PATCH] Update stream position after seeking is done
- To: fontconfig@xxxxxxxxxxxxxxxxxxxxx
- Subject: [PATCH] Update stream position after seeking is done
- From: Jiang Jiang <gzjjgod@xxxxxxxxx>
- Date: Tue, 29 Nov 2011 11:56:05 +0100
- Cc: Jiang Jiang <jiang.jiang@xxxxxxxxx>
- Delivered-to: fontconfig@xxxxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=3LTlqDRgicy4413qIzTCE+jzHnZ1Sb7PhnGLI9ruUBQ=; b=OfF24eooJB1Mcrci3fZ87bR/1ayhbsbKoMxemBUORJgsVR9g0k1h6dWV/afvDbIuej 6c0dGHlau4ZR7+kX8+LsaTMZWaviquc7eUEKt+LMOwF90DfEWCJVk7b9Agpqvny7LyHN THE+SQP6eZIkgKfhbGc/qbXCAVqmSYbfsSgaQ=
From: Jiang Jiang <jiang.jiang@xxxxxxxxx>
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
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig
[Fedora Users]
[Fedora Cloud]
[Kernel]
[Fedora Legacy]
[Fedora Packaging]
[Fedora Desktop]
[PAM]
[Red Hat Development]
[Red Hat 9]
[Gimp]
[Yosemite News]