[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp |
Date: |
Tue, 25 Sep 2007 11:10:00 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/09/25 11:10:00
Modified files:
. : ChangeLog
server : edit_text_character.cpp
Log message:
* server/edit_text_character.cpp (set_member): handle attempts
to set _width and _height to non-finite or negative values.
Fixes assertion failures in playing
flvplayer-debug-lulutv-beta4.swf.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4401&r2=1.4402
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.121&r2=1.122
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4401
retrieving revision 1.4402
diff -u -b -r1.4401 -r1.4402
--- ChangeLog 25 Sep 2007 09:44:45 -0000 1.4401
+++ ChangeLog 25 Sep 2007 11:09:59 -0000 1.4402
@@ -1,3 +1,10 @@
+2007-09-25 Sandro Santilli <address@hidden>
+
+ * server/edit_text_character.cpp (set_member): handle attempts
+ to set _width and _height to non-finite or negative values.
+ Fixes assertion failures in playing
+ flvplayer-debug-lulutv-beta4.swf.
+
2007-09-25 Benjamin Wolsey <address@hidden>
* gui/gtk.cpp: clean up properties dialogue.
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -b -r1.121 -r1.122
--- server/edit_text_character.cpp 23 Sep 2007 08:48:17 -0000 1.121
+++ server/edit_text_character.cpp 25 Sep 2007 11:10:00 -0000 1.122
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: edit_text_character.cpp,v 1.121 2007/09/23 08:48:17 cmusick Exp $ */
+/* $Id: edit_text_character.cpp,v 1.122 2007/09/25 11:10:00 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -814,6 +814,23 @@
case NSV::PROP_uWIDTH:
{
float nw = PIXELS_TO_TWIPS(val.to_number()); // TODO: pass an
as_environment !
+ if ( ! finite(nw) )
+ {
+ // might be our fault, see the TODO above (missing to
pass as_environment out..)
+ IF_VERBOSE_ASCODING_ERRORS(
+ log_aserror(_("Attempt to set TextField._width to %g"),
nw);
+ );
+ return;
+ }
+
+ if ( nw < 0.0f )
+ {
+ IF_VERBOSE_ASCODING_ERRORS(
+ log_aserror(_("Attempt to set TextField._width to a
negative number: %g, toggling sign"), nw);
+ );
+ nw = -nw;
+ }
+
if ( _bounds.width() == nw )
{
#ifdef GNASH_DEBUG_TEXTFIELDS
@@ -841,7 +858,9 @@
float xmin = _bounds.getMinX();
float ymin = _bounds.getMinY();
float ymax = _bounds.getMaxY();
- _bounds.setTo(xmin, ymin, xmin+nw, ymax);
+ float xmax = xmin+nw;
+ assert(xmin <= xmax);
+ _bounds.setTo(xmin, ymin, xmax, ymax);
assert(_bounds.width() == nw);
// previously truncated text might get visible now
@@ -854,6 +873,23 @@
case NSV::PROP_uHEIGHT:
{
float nh = PIXELS_TO_TWIPS(val.to_number()); // TODO: pass an
as_environment !
+ if ( ! finite(nh) )
+ {
+ // might be our fault, see the TODO above (missing to
pass as_environment out..)
+ IF_VERBOSE_ASCODING_ERRORS(
+ log_aserror(_("Attempt to set TextField._height to
%g"), nh);
+ );
+ return;
+ }
+
+ if ( nh < 0.0f )
+ {
+ IF_VERBOSE_ASCODING_ERRORS(
+ log_aserror(_("Attempt to set TextField._height to a
negative number: %g, toggling sign"), nh);
+ );
+ nh = -nh;
+ }
+
if ( _bounds.height() == nh )
{
#ifdef GNASH_DEBUG_TEXTFIELDS