gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/avm2 r9480: Fix seekBy so that it seeks th


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9480: Fix seekBy so that it seeks the correct number of bytes.
Date: Sun, 17 Aug 2008 21:53:33 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9480
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Sun 2008-08-17 21:53:33 +0800
message:
  Fix seekBy so that it seeks the correct number of bytes.
modified:
  libcore/vm/CodeStream.h
=== modified file 'libcore/vm/CodeStream.h'
--- a/libcore/vm/CodeStream.h   2008-08-17 13:16:54 +0000
+++ b/libcore/vm/CodeStream.h   2008-08-17 13:53:33 +0000
@@ -152,10 +152,15 @@
        /// Change the current position by a relative value.
        void seekBy(int change)
        {
-               if ((change > 0 && change > (mEnd - mCurrent)) ||
-                       (change < 0 && -change > (mCurrent - mRaw)))
-                       throw CodeStreamException();
-               mCurrent += change;
+               //This is ugly, but I don't think we have any way of knowing 
what index of the stream we are at,
+               //so the only way to make sure we don't go past the end of the 
stream is to jump one byte at a
+               //time.
+               for(int i=0;i<change;i++){
+                       if (mCurrent == mEnd){
+                               throw CodeStreamException();
+                       }
+                       mCurrent ++;
+               }
        }
 
        /// Set the current position to an absolute value (relative to the 
start)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]