summaryrefslogtreecommitdiffstats
path: root/src/base/ftsystem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/ftsystem.c')
-rw-r--r--src/base/ftsystem.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c
index 4d06d6d..ba86005 100644
--- a/src/base/ftsystem.c
+++ b/src/base/ftsystem.c
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific FreeType low-level system interface (body). */
/* */
-/* Copyright 1996-2001, 2002, 2006, 2008, 2009 by */
+/* Copyright 1996-2001, 2002, 2006, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -192,7 +192,9 @@
/* count :: The number of bytes to read from the stream. */
/* */
/* <Return> */
- /* The number of bytes actually read. */
+ /* The number of bytes actually read. If `count' is zero (this is, */
+ /* the function is used for seeking), a non-zero return value */
+ /* indicates an error. */
/* */
FT_CALLBACK_DEF( unsigned long )
ft_ansi_stream_io( FT_Stream stream,
@@ -203,6 +205,9 @@
FT_FILE* file;
+ if ( !count && offset > stream->size )
+ return 1;
+
file = STREAM_FILE( stream );
if ( stream->pos != offset )