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: Petter Reinholdtsen
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1854-g39751bc
Date: Sat, 25 Jan 2014 17:47:02 +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  39751bcf754c27838fd4458aef47b5cffe7aed51 (commit)
      from  8a8759c7b95b6a3093f0556a3bef8c6cbcd93d0e (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=39751bcf754c27838fd4458aef47b5cffe7aed51


commit 39751bcf754c27838fd4458aef47b5cffe7aed51
Author: Petter Reinholdtsen <address@hidden>
Date:   Sat Jan 25 18:44:11 2014 +0100

    Make sure movie_root::processInvoke() never divide by zero if called
    when the total loaded is zero (Coverity CID 1149142) (patch #8274).

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 1bae796..3ec506c 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -1626,7 +1626,11 @@ movie_root::processInvoke(ExternalInterface::invoke_t 
*invoke)
         MovieClip *mc = getLevel(0);
         int loaded = mc->get_bytes_loaded();
         int total = mc->get_bytes_total();
-        as_value val((loaded/total) * 100);
+        int percent = 0;
+        if (total > 0) { /* avoid division by zero */
+          percent = 100 * loaded / total;
+        }
+        as_value val(percent);
         // PercentLoaded sends the percentage
         ss << ExternalInterface::toXML(val);    
     } else if (invoke->name == "Play") {

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

Summary of changes:
 libcore/movie_root.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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