[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/parser/shape_character_d...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/parser/shape_character_d... |
Date: |
Mon, 14 May 2007 17:23:16 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/05/14 17:23:16
Modified files:
. : ChangeLog
server/parser : shape_character_def.cpp shape_character_def.h
Log message:
* server/parser/shape_character_def.{cpp,h}: add
ShapeRecordFlags
enum to use symbolic names while parsing. Don't change tag
type
when encountering the flagHasNewStyles set and the tag type
is DEFINESHAPE (for which supposedly that flag is reserved);
keep parsing instead and print a message about SWF malformacy.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3202&r2=1.3203
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.cpp?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.h?cvsroot=gnash&r1=1.11&r2=1.12
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3202
retrieving revision 1.3203
diff -u -b -r1.3202 -r1.3203
--- ChangeLog 14 May 2007 16:56:10 -0000 1.3202
+++ ChangeLog 14 May 2007 17:23:15 -0000 1.3203
@@ -1,5 +1,10 @@
2007-05-14 Sandro Santilli <address@hidden>
+ * server/parser/shape_character_def.{cpp,h}: add ShapeRecordFlags
+ enum to use symbolic names while parsing. Don't change tag type
+ when encountering the flagHasNewStyles set and the tag type
+ is DEFINESHAPE (for which supposedly that flag is reserved);
+ keep parsing instead and print a message about SWF malformacy.
* gui/Player.cpp (run): exit with a failure if input movie has
collapsed dimensions (malformed SWF most likely).
* server/asobj/xml.{cpp,h}: change extractNode interface to return a
Index: server/parser/shape_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/parser/shape_character_def.cpp 30 Apr 2007 13:03:31 -0000
1.21
+++ server/parser/shape_character_def.cpp 14 May 2007 17:23:15 -0000
1.22
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: shape_character_def.cpp,v 1.21 2007/04/30 13:03:31 strk Exp $ */
+/* $Id: shape_character_def.cpp,v 1.22 2007/05/14 17:23:15 strk Exp $ */
// Based on the public domain shape.cpp of Thatcher Ulrich <address@hidden>
2003
@@ -205,13 +205,14 @@
path current_path;
#define SHAPE_LOG 0
+
// SHAPERECORDS
for (;;) {
int type_flag = in->read_uint(1);
if (type_flag == 0) {
// Parse the record.
int flags = in->read_uint(5);
- if (flags == 0) {
+ if (flags == flagEnd) {
// End of shape records.
// Store the current path if any.
@@ -223,7 +224,7 @@
break;
}
- if (flags & 0x01) {
+ if (flags & flagMove) {
// move_to = 1;
// Store the current path if any, and prepare a fresh one.
@@ -249,7 +250,8 @@
log_parse(_(" shape_character read: moveto %4g %4g"), x,
y);
);
}
- if ((flags & 0x02) && num_fill_bits > 0) {
+ if ((flags & flagFillStyle0Change) && num_fill_bits > 0)
+ {
// fill_style_0_change = 1;
if (! current_path.is_empty()) {
m_paths.push_back(current_path);
@@ -270,7 +272,8 @@
);
}
- if ((flags & 0x04) && num_fill_bits > 0) {
+ if ((flags & flagFillStyle1Change) && num_fill_bits > 0)
+ {
// fill_style_1_change = 1;
if (! current_path.is_empty()) {
m_paths.push_back(current_path);
@@ -289,7 +292,8 @@
}
);
}
- if ((flags & 0x08) && num_line_bits > 0) {
+ if ((flags & flagLineStyleChange) && num_line_bits > 0)
+ {
// line_style_change = 1;
if (! current_path.is_empty()) {
m_paths.push_back(current_path);
@@ -309,11 +313,14 @@
}
);
}
- if (flags & 0x10) {
- if (tag_type == SWF::DEFINESHAPE) {
- tag_type += SWF::DEFINESHAPE2; // ?? why is this ??
+ if (flags & flagHasNewStyles)
+ {
+ IF_VERBOSE_MALFORMED_SWF(
+ if (tag_type == SWF::DEFINESHAPE)
+ {
+ log_swferror("unexpected HasNewStyle flag in a
DEFINESHAPE tag shape record");
}
- assert(tag_type >= 22);
+ )
IF_VERBOSE_PARSE (
log_parse(_(" shape_character read: more fill styles"));
Index: server/parser/shape_character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/shape_character_def.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/parser/shape_character_def.h 11 Apr 2007 14:20:20 -0000 1.11
+++ server/parser/shape_character_def.h 14 May 2007 17:23:16 -0000 1.12
@@ -5,7 +5,7 @@
// Quadratic bezier outline shapes, the basis for most SWF rendering.
-/* $Id: shape_character_def.h,v 1.11 2007/04/11 14:20:20 strk Exp $ */
+/* $Id: shape_character_def.h,v 1.12 2007/05/14 17:23:16 strk Exp $ */
#ifndef GNASH_SHAPE_CHARACTER_DEF_H
#define GNASH_SHAPE_CHARACTER_DEF_H
@@ -83,6 +83,16 @@
private:
+ /// Shape record flags
+ enum ShapeRecordFlags {
+ flagEnd = 0x00,
+ flagMove = 0x01,
+ flagFillStyle0Change = 0x02,
+ flagFillStyle1Change = 0x04,
+ flagLineStyleChange = 0x08,
+ flagHasNewStyles = 0x10
+ };
+
void sort_and_clean_meshes() const;
- [Gnash-commit] gnash ChangeLog server/parser/shape_character_d...,
Sandro Santilli <=