shithub: freetype+ttf2subf

Download patch

ref: fdc225b153d5ad0ebcacfee96692fa61e603272d
parent: 8cd9575c27d01a313ef13196c1fa2d67d831b2a1
author: David Turner <[email protected]>
date: Mon Jan 17 06:21:49 EST 2000

fixed another small bug in the FT_Read_xxxx functions
(they didn't updated the stream position in the case of
disk-based streams. This went un-noticed under Linux
which uses memory-mapped files by default)

git/fs: mount .git/fs: mount/attach disallowed
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -285,10 +285,11 @@
     else
     {
       if (stream->pos < stream->size)
-        result = stream->base[stream->pos++];
+        result = stream->base[stream->pos];
       else
         goto Fail;
     }
+    stream->pos++;
     return result;
 
   Fail:
@@ -327,13 +328,11 @@
       }
 
       if (p)
-      {
-        result       = NEXT_Short(p);
-        stream->pos += 2;
-      }
+        result = NEXT_Short(p);
     }
     else goto Fail;
 
+    stream->pos += 2;
     return result;
 
   Fail:
@@ -372,13 +371,11 @@
       }
 
       if (p)
-      {
-        result       = NEXT_Offset(p);
-        stream->pos += 3;
-      }
+        result = NEXT_Offset(p);
     }
     else goto Fail;
 
+    stream->pos += 3;
     return result;
 
   Fail:
@@ -417,13 +414,11 @@
       }
 
       if (p)
-      {
-        result       = NEXT_Long(p);
-        stream->pos += 4;
-      }
+        result = NEXT_Long(p);
     }
     else goto Fail;
 
+    stream->pos += 4;
     return result;
 
   Fail: