diff -uNr --exclude=.svn --exclude='*.rst' trunk/fpcsrc/rtl/objpas/classes/streams.inc trunk.w/fpcsrc/rtl/objpas/classes/streams.inc
--- trunk/fpcsrc/rtl/objpas/classes/streams.inc	2008-07-21 23:56:12.000000000 +0100
+++ trunk.w/fpcsrc/rtl/objpas/classes/streams.inc	2008-12-31 17:46:05.000000000 +0000
@@ -521,9 +521,15 @@
   Case Origin of
     soFromBeginning : FPosition:=Offset;
     soFromEnd       : FPosition:=FSize+Offset;
-    soFromCurrent   : FpoSition:=FPosition+Offset;
+    soFromCurrent   : FPosition:=FPosition+Offset;
   end;
+  if FPosition < 0 then
+    {$IFDEF DEBUG}
+    raise Exception.Create('TCustomMemoryStream');
+    {$ELSE}
+    FPosition := 0;
+    {$ENDIF}
   Result:=FPosition;
 end;
 
 

