[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libamf/sol.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog libamf/sol.cpp |
Date: |
Sat, 05 Jan 2008 10:55:47 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/01/05 10:55:47
Modified files:
. : ChangeLog
libamf : sol.cpp
Log message:
(SOL::readFile): fix magic number consistency check.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5312&r2=1.5313
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/sol.cpp?cvsroot=gnash&r1=1.12&r2=1.13
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5312
retrieving revision 1.5313
diff -u -b -r1.5312 -r1.5313
--- ChangeLog 5 Jan 2008 10:46:42 -0000 1.5312
+++ ChangeLog 5 Jan 2008 10:55:46 -0000 1.5313
@@ -1,5 +1,7 @@
2008-01-05 Sandro Santilli <address@hidden>
+ * libamf/sol.cpp (SOL::readFile): fix magic number consistency
+ check.
* testsuite/: Makefile.am, gnashrc.in: allow read-write access
to SOL under the testsuite directory.
* testsuite/libbase/: TCXXRc.cpp, gnashrc.in: test set SOLSafeDir
Index: libamf/sol.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/sol.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- libamf/sol.cpp 5 Jan 2008 01:28:34 -0000 1.12
+++ libamf/sol.cpp 5 Jan 2008 10:55:46 -0000 1.13
@@ -298,7 +298,7 @@
{
// GNASH_REPORT_FUNCTION;
struct stat st;
- boost::uint16_t magic, size;
+ boost::uint16_t size;
boost::uint8_t *buf, *ptr;
int bodysize;
@@ -311,9 +311,7 @@
ptr = buf = new boost::uint8_t[_filesize+1];
ifs.read(reinterpret_cast<char *>(buf), _filesize);
- // extract the magic number
- memcpy(&magic, buf, 2);
-// magic = ntohl(magic);
+ // skip the magic number (will check later)
ptr += 2;
// extract the file size
@@ -321,10 +319,11 @@
length = ntohl(length);
ptr += 4;
- // extract the file marker field
-// char *marker = ptr;
+ // skip the file marker field
ptr += 10;
- if ((buf[0] == 0) && (buf[1] == 0xbf)) {
+
+ // consistency check
+ if ((buf[1] == 0) && (buf[0] == 0xbf)) {
if (bodysize == length) {
log_debug("%s is an SOL file", filespec.c_str());
} else {
- [Gnash-commit] gnash ChangeLog libamf/sol.cpp,
Sandro Santilli <=