[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/font.cpp server/parser/s...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/font.cpp server/parser/s... |
Date: |
Mon, 14 May 2007 20:28:14 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/05/14 20:28:14
Modified files:
. : ChangeLog
server : font.cpp
server/parser : shape_character_def.cpp
Log message:
* server/font.cpp (readDefineFont, readDefineFont2_or_3): pass
shape_character_def the real tag we're parsing.
* server/parser/shape_character_def.cpp (read): when parsing
DEFINEFONT tags provide a dummy solid white fill style to
act as a placeholder for consistency checking.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3209&r2=1.3210
http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.cpp?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.cpp?cvsroot=gnash&r1=1.24&r2=1.25
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3209
retrieving revision 1.3210
diff -u -b -r1.3209 -r1.3210
--- ChangeLog 14 May 2007 20:15:02 -0000 1.3209
+++ ChangeLog 14 May 2007 20:28:13 -0000 1.3210
@@ -1,5 +1,13 @@
2007-05-14 Sandro Santilli <address@hidden>
+ * server/font.cpp (readDefineFont, readDefineFont2_or_3): pass
+ shape_character_def the real tag we're parsing.
+ * server/parser/shape_character_def.cpp (read): when parsing
+ DEFINEFONT tags provide a dummy solid white fill style to
+ act as a placeholder for consistency checking.
+
+2007-05-14 Sandro Santilli <address@hidden>
+
* server/fill_style.{cpp,h}: document default constructor and type.
* server/vm/ASHandlers.cpp (CommonGetUrl): check url security also
when invoking firefox.
Index: server/font.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/font.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- server/font.cpp 14 May 2007 19:04:46 -0000 1.29
+++ server/font.cpp 14 May 2007 20:28:14 -0000 1.30
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: font.cpp,v 1.29 2007/05/14 19:04:46 strk Exp $ */
+/* $Id: font.cpp,v 1.30 2007/05/14 20:28:14 strk Exp $ */
// Based on the public domain work of Thatcher Ulrich <address@hidden> 2003
@@ -175,7 +175,7 @@
// Create & read the shape.
shape_character_def* s = new
shape_character_def;
- s->read(in, SWF::DEFINESHAPE, false, m); // why
not DEFINEFONT ?
+ s->read(in, SWF::DEFINEFONT, false, m); // why
not DEFINEFONT ?
m_glyphs[i] = s;
}}
@@ -263,7 +263,7 @@
// Create & read the shape.
shape_character_def* s = new
shape_character_def;
- s->read(in, SWF::DEFINESHAPE2, false, m); //
why not DEFINEFONT2 ?
+ s->read(in, SWF::DEFINEFONT2, false, m); // why
not DEFINEFONT2 ?
m_glyphs[i] = s;
}}
Index: server/parser/shape_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- server/parser/shape_character_def.cpp 14 May 2007 18:44:43 -0000
1.24
+++ server/parser/shape_character_def.cpp 14 May 2007 20:28:14 -0000
1.25
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: shape_character_def.cpp,v 1.24 2007/05/14 18:44:43 strk Exp $ */
+/* $Id: shape_character_def.cpp,v 1.25 2007/05/14 20:28:14 strk Exp $ */
// Based on the public domain shape.cpp of Thatcher Ulrich <address@hidden>
2003
@@ -173,7 +173,8 @@
shape_character_def::read(stream* in, int tag_type, bool with_style,
movie_definition* m)
{
- if (with_style) {
+ if (with_style)
+ {
m_bound.read(in);
IF_VERBOSE_PARSE
@@ -186,7 +187,19 @@
read_line_styles(m_line_styles, in, tag_type);
}
- log_msg("Read %u fill styles, %u line styles", m_fill_styles.size(),
m_line_styles.size());
+ /// Adding a dummy fill style is just needed to make the
+ /// parser somewhat more robust. This fill style is not
+ /// really used, as text rendering will use style information
+ /// from TEXTRECORD tag instead.
+ ///
+ if ( tag_type == SWF::DEFINEFONT || tag_type == SWF::DEFINEFONT2 )
+ {
+ assert(!with_style);
+ m_fill_styles.push_back(fill_style());
+ }
+
+
+ //log_msg("Read %u fill styles, %u line styles", m_fill_styles.size(),
m_line_styles.size());
int num_fill_bits = in->read_uint(4);
int num_line_bits = in->read_uint(4);
@@ -263,11 +276,11 @@
current_path.m_ax = x;
current_path.m_ay = y;
}
- int style = in->read_uint(num_fill_bits);
+ unsigned style = in->read_uint(num_fill_bits);
if (style > 0) {
style += fill_base;
}
- if ( 1 || style <= m_fill_styles.size() ) // 1-based index !
TODO: signedness comparison mismatch
+ if ( style <= m_fill_styles.size() ) // 1-based index
{
current_path.setLeftFill(style);
IF_VERBOSE_PARSE(
@@ -281,7 +294,6 @@
IF_VERBOSE_MALFORMED_SWF(
log_swferror(_("Unknown fill style %d in
fillStyle0Change record - %u defined"), style, m_fill_styles.size());
);
- current_path.setLeftFill(0);
}
}
@@ -294,11 +306,11 @@
current_path.m_ax = x;
current_path.m_ay = y;
}
- int style = in->read_uint(num_fill_bits);
+ unsigned style = in->read_uint(num_fill_bits);
if (style > 0) {
style += fill_base;
}
- if ( 1 || style <= m_fill_styles.size() ) // 1-based index !
TODO: signedness comparison mismatch
+ if ( style <= m_fill_styles.size() ) // 1-based index
{
current_path.setRightFill(style); // getRightFill() =
style;
IF_VERBOSE_PARSE (
@@ -310,9 +322,8 @@
else
{
IF_VERBOSE_MALFORMED_SWF(
- log_swferror(_("Unknown fill style %d in
fillStyle1Change record "), style);
+ log_swferror(_("Unknown fill style %d in
fillStyle1Change record, %u defined "), style, m_fill_styles.size());
);
- current_path.setRightFill(0);
}
}
if ((flags & flagLineStyleChange) && num_line_bits > 0)
@@ -324,11 +335,11 @@
current_path.m_ax = x;
current_path.m_ay = y;
}
- int style = in->read_uint(num_line_bits);
+ unsigned style = in->read_uint(num_line_bits);
if (style > 0) {
style += line_base;
}
- if ( 1 || style <= m_line_styles.size() ) // 1-based index !
TODO: signedness comparison mismatch
+ if ( style <= m_line_styles.size() ) // 1-based index
{
current_path.setLineStyle(style);
IF_VERBOSE_PARSE (
@@ -341,20 +352,20 @@
else
{
IF_VERBOSE_MALFORMED_SWF(
- log_swferror(_("Unknown line style %d in
lienStyleChange record "), style);
+ log_swferror(_("Unknown line style %d in
lineStyleChange record, %u defined "), style, m_line_styles.size());
);
- current_path.setLineStyle(0);
}
}
if (flags & flagHasNewStyles)
{
- if (tag_type == SWF::DEFINESHAPE)
+ if (!with_style)
{
IF_VERBOSE_MALFORMED_SWF(
- log_swferror("unexpected HasNewStyle flag in a
DEFINESHAPE tag shape record");
+ log_swferror("Unexpected HasNewStyle flag in tag %d
shape record", tag_type);
)
// Used to be tag_type += SWF::DEFINESHAPE2, but
// I can't belive any such thing could be correct...
+ continue;
}
IF_VERBOSE_PARSE (
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/font.cpp server/parser/s...,
Sandro Santilli <=