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-1979-g0cdd056
Date: Tue, 13 May 2014 22:21:29 +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  0cdd056bf1403e2432b238854bb3fd84ef335098 (commit)
      from  d43c191b957cfe9be5051d142c2d6b9a60b0d1ec (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=0cdd056bf1403e2432b238854bb3fd84ef335098


commit 0cdd056bf1403e2432b238854bb3fd84ef335098
Author: Bastiaan Jacques <address@hidden>
Date:   Wed May 14 00:19:39 2014 +0200

    Savannah #42200: Don't dereference a null pointer.

diff --git a/libcore/asobj/flash/display/BitmapData_as.cpp 
b/libcore/asobj/flash/display/BitmapData_as.cpp
index 273aabc..cc317e3 100644
--- a/libcore/asobj/flash/display/BitmapData_as.cpp
+++ b/libcore/asobj/flash/display/BitmapData_as.cpp
@@ -933,25 +933,30 @@ bitmapdata_copyPixels(const fn_call& fn)
     rect->get_member(NSV::PROP_X, &x);
     rect->get_member(NSV::PROP_Y, &y);
     rect->get_member(NSV::PROP_WIDTH, &w);
-    rect->get_member(NSV::PROP_HEIGHT, &h);    
+    rect->get_member(NSV::PROP_HEIGHT, &h);
+
+    int destX = 0;
+    int destY = 0;
     
+    // Find true source rect and true dest rect.
     as_object* destpoint = toObject(fn.arg(2), getVM(fn));
-    as_value px, py;
+    if (destpoint) {
+        as_value px, py;
     
-    destpoint->get_member(NSV::PROP_X, &px);
-    destpoint->get_member(NSV::PROP_Y, &py);
+        destpoint->get_member(NSV::PROP_X, &px);
+        destpoint->get_member(NSV::PROP_Y, &py);
+
+        destX = toInt(px, getVM(fn));
+        destY = toInt(py, getVM(fn));
+    }
 
     // TODO: remaining arguments.
 
-    // Find true source rect and true dest rect.
     int sourceX = toInt(x, getVM(fn));
     int sourceY = toInt(y, getVM(fn));
     int sourceW = toInt(w, getVM(fn));
     int sourceH = toInt(h, getVM(fn));
 
-    int destX = toInt(px, getVM(fn));
-    int destY = toInt(py, getVM(fn));
-
     // Any part of the source rect that is not in the image (i.e.
     // above or left) is concatenated to the destination offset.
     if (sourceX < 0) destX -= sourceX;
diff --git a/testsuite/actionscript.all/BitmapData.as 
b/testsuite/actionscript.all/BitmapData.as
index f7ca139..29756de 100644
--- a/testsuite/actionscript.all/BitmapData.as
+++ b/testsuite/actionscript.all/BitmapData.as
@@ -637,6 +637,14 @@ dest.copyPixels(source, new Rect(-50, -50, 100, 100), new 
Point(0, 0));
  check_equals(dest.getPixel(52, 10), 0xff0000);
  check_equals(dest.getPixel(10, 52), 0xff0000);
 
+// null copypixel argument: should be the same as Point(0,0)
+dest = new flash.display.BitmapData(100, 100, false, 0xff0000);
+dest.copyPixels(source, new Rect(-50, -50, 100, 100), null);
+ check_equals(dest.getPixel(10, 10), 0xff0000);
+ check_equals(dest.getPixel(52, 52), 0x0000ff);
+ check_equals(dest.getPixel(52, 10), 0xff0000);
+ check_equals(dest.getPixel(10, 52), 0xff0000);
+
 dest = new flash.display.BitmapData(100, 100, false, 0xff0000);
 dest.copyPixels(source, new Rect(0, 0, 100, 100), new Point(50, 50));
  check_equals(dest.getPixel(10, 10), 0xff0000);
@@ -1146,6 +1154,6 @@ flash.display.BitmapData.prototype = e;
 // END OF TEST
 //-------------------------------------------------------------
 
-totals(406);
+totals(410);
 
 #endif // OUTPUT_VERSION >= 8

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

Summary of changes:
 libcore/asobj/flash/display/BitmapData_as.cpp |   21 +++++++++++++--------
 testsuite/actionscript.all/BitmapData.as      |   10 +++++++++-
 2 files changed, 22 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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