gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/rtmp r9583: Use log_error(), not log_parse


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9583: Use log_error(), not log_parse() for FLV header parsing errors.
Date: Wed, 13 Aug 2008 16:29:05 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9583
committer: address@hidden
branch nick: rtmp
timestamp: Wed 2008-08-13 16:29:05 -0600
message:
  Use log_error(), not log_parse() for FLV header parsing errors.
modified:
  libamf/flv.cpp
=== modified file 'libamf/flv.cpp'
--- a/libamf/flv.cpp    2008-08-08 18:10:21 +0000
+++ b/libamf/flv.cpp    2008-08-13 22:29:05 +0000
@@ -93,13 +93,13 @@
 
     // test the magic number
     if (memcmp(_header.sig, "FLV", 3) != 0) {
-       log_parse("Bad magic number for FLV file!");
+       log_error("Bad magic number for FLV file!");
        return 0;
     }
 
     // Make sure the version is legit, it should alwys be 1
     if (_header.version != 0x1) {
-       log_parse("Bad version in FLV header! %d", _header.version);
+       log_error("Bad version in FLV header! %d", _header.version);
                  return 0;
     }
 
@@ -113,15 +113,15 @@
     // Be lazy, as head_size is an array of 4 bytes, and not an integer in the 
data
     // structure. This is to get around possible padding done to the data 
structure
     // done by some compilers.
-    boost::uint32_t *size = reinterpret_cast<boost::uint32_t 
*>(_header.head_size);
+    boost::uint32_t size = *(reinterpret_cast<boost::uint32_t 
*>(_header.head_size));
 
     // The header size is big endian
-    *size = ntohl(*size);
+    size = ntohl(size);
     
     // The header size is always 9, guess it could change some day in the far 
future, so
     // we should use it.
-    if (*size != 0x9) {
-       log_parse("Bad header size in FLV header! %d", _header.head_size);
+    if (size != 0x9) {
+       log_error("Bad header size in FLV header! %d", _header.head_size);
                  return 0;
     }
     
@@ -284,9 +284,7 @@
 {
 //    GNASH_REPORT_FUNCTION;
     boost::uint32_t bodysize = 0;
-    // FIXME: I bet thi sis endian dependant
-    memcpy((char *)(&bodysize) + 1, num, 3);
-//                swapBytes(&bodysize, 3);
+    memcpy((char *)(&bodysize), num, 4);
     bodysize = ntohl(bodysize);
 }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]