Skip some common SWF tags (FileAttributes, Metadata and SetBackgroundColor) instead of failing to load a SWF file if any of them are encountered.

This commit is contained in:
Jonathan Young 2013-09-21 19:27:03 +10:00
parent a1776a22d0
commit adf2b63e88
3 changed files with 37 additions and 0 deletions

View file

@ -389,6 +389,9 @@ private:
bool LoadSWF( const char* fullpath );
bool LoadBinary( const char* bfilename, ID_TIME_T sourceTime );
void WriteBinary( const char* bfilename );
void FileAttributes( idSWFBitStream& bitstream );
void Metadata( idSWFBitStream& bitstream );
void SetBackgroundColor( idSWFBitStream& bitstream );
//----------------------------------
// SWF_Shapes.cpp

View file

@ -526,3 +526,34 @@ void idSWF::WriteBinary( const char* bfilename )
}
}
}
/*
===================
idSWF::FileAttributes
Extra data that won't fit in a SWF header
===================
*/
void idSWF::FileAttributes( idSWFBitStream& bitstream )
{
bitstream.Seek( 5 ); // 5 booleans
}
/*
===================
idSWF::Metadata
===================
*/
void idSWF::Metadata( idSWFBitStream& bitstream )
{
bitstream.ReadString(); // XML string
}
/*
===================
idSWF::SetBackgroundColor
===================
*/
void idSWF::SetBackgroundColor( idSWFBitStream& bitstream )
{
bitstream.Seek( 4 ); // int
}

View file

@ -105,6 +105,9 @@ void idSWFSprite::Load( idSWFBitStream& bitstream, bool parseDictionary )
switch( tag )
{
#define HANDLE_SWF_TAG( x ) case Tag_##x: swf->x( tagStream ); break;
HANDLE_SWF_TAG( FileAttributes );
HANDLE_SWF_TAG( Metadata );
HANDLE_SWF_TAG( SetBackgroundColor );
HANDLE_SWF_TAG( JPEGTables );
HANDLE_SWF_TAG( DefineBits );
HANDLE_SWF_TAG( DefineBitsJPEG2 );