gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1983-gf348eb8
Date: Thu, 15 May 2014 08:27:19 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  f348eb860ac0d54995e1cc0e351b315ec91b1b31 (commit)
      from  66b47f411a7f7151c55319a6a3d1782409404cc6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=f348eb860ac0d54995e1cc0e351b315ec91b1b31


commit f348eb860ac0d54995e1cc0e351b315ec91b1b31
Author: Bastiaan Jacques <address@hidden>
Date:   Thu May 15 10:25:44 2014 +0200

    Don't try to read zero bits.

diff --git a/libcore/parser/TypesParser.cpp b/libcore/parser/TypesParser.cpp
index 15faccd..0d8e52f 100644
--- a/libcore/parser/TypesParser.cpp
+++ b/libcore/parser/TypesParser.cpp
@@ -58,9 +58,11 @@ readSWFMatrix(SWFStream& in)
     if (has_scale) {
         in.ensureBits(5);
         const boost::uint8_t scale_nbits = in.read_uint(5);
-        in.ensureBits(scale_nbits * 2);
-        sx = in.read_sint(scale_nbits);
-        sy = in.read_sint(scale_nbits);
+        if (scale_nbits) {
+            in.ensureBits(scale_nbits * 2);
+            sx = in.read_sint(scale_nbits);
+            sy = in.read_sint(scale_nbits);
+        }
     }
 
     in.ensureBits(1);
@@ -69,11 +71,12 @@ readSWFMatrix(SWFStream& in)
     boost::int32_t shy = 0;
     if (has_rotate) {
         in.ensureBits(5);
-        int rotate_nbits = in.read_uint(5);
-
-        in.ensureBits(rotate_nbits * 2);
-        shx = in.read_sint(rotate_nbits);
-        shy = in.read_sint(rotate_nbits);
+        unsigned int rotate_nbits = in.read_uint(5);
+        if (rotate_nbits) {
+            in.ensureBits(rotate_nbits * 2);
+            shx = in.read_sint(rotate_nbits);
+            shy = in.read_sint(rotate_nbits);
+        }
     }
 
     in.ensureBits(5);
@@ -129,12 +132,16 @@ readRect(SWFStream& in)
     in.align();
     in.ensureBits(5);
     const int nbits = in.read_uint(5);
-    in.ensureBits(nbits*4);
+
+    int minx = 0, maxx = 0, miny = 0, maxy = 0;
     
-    const int minx = in.read_sint(nbits);
-    const int maxx = in.read_sint(nbits);
-    const int miny = in.read_sint(nbits);
-    const int maxy = in.read_sint(nbits);
+    if (nbits > 0) {
+       in.ensureBits(nbits*4);
+       minx = in.read_sint(nbits);
+       maxx = in.read_sint(nbits);
+       miny = in.read_sint(nbits);
+       maxy = in.read_sint(nbits);
+    }
 
     // Check if this SWFRect is valid.
     if (maxx < minx || maxy < miny) {

-----------------------------------------------------------------------

Summary of changes:
 libcore/parser/TypesParser.cpp |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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