forked from pool/freetype2
e3508cd4d6
looks good thanks for the update OBS-URL: https://build.opensuse.org/request/show/55068 OBS-URL: https://build.opensuse.org/package/show/M17N/freetype2?expand=0&rev=40
39 lines
1.1 KiB
Diff
39 lines
1.1 KiB
Diff
Index: freetype-2.4.2/src/base/ftstream.c
|
|
===================================================================
|
|
--- freetype-2.4.2.orig/src/base/ftstream.c
|
|
+++ freetype-2.4.2/src/base/ftstream.c
|
|
@@ -70,8 +70,16 @@
|
|
{
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
+ /* note that seeking to the first position after the file is valid */
|
|
+ if ( pos > stream->size )
|
|
+ {
|
|
+ FT_ERROR(( "FT_Stream_Seek:"
|
|
+ " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
|
+ pos, stream->size ));
|
|
+ error = FT_Err_Invalid_Stream_Operation;
|
|
+ }
|
|
|
|
- if ( stream->read )
|
|
+ if ( !error && stream->read )
|
|
{
|
|
if ( stream->read( stream, pos, 0, 0 ) )
|
|
{
|
|
@@ -82,15 +90,6 @@
|
|
error = FT_Err_Invalid_Stream_Operation;
|
|
}
|
|
}
|
|
- /* note that seeking to the first position after the file is valid */
|
|
- else if ( pos > stream->size )
|
|
- {
|
|
- FT_ERROR(( "FT_Stream_Seek:"
|
|
- " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
|
- pos, stream->size ));
|
|
-
|
|
- error = FT_Err_Invalid_Stream_Operation;
|
|
- }
|
|
|
|
if ( !error )
|
|
stream->pos = pos;
|