gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r10049: make less verbose, fix old fo


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r10049: make less verbose, fix old formatting errors.
Date: Thu, 26 Mar 2009 10:47:43 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10049
committer: address@hidden
branch nick: rtmp
timestamp: Thu 2009-03-26 10:47:43 -0600
message:
  make less verbose, fix old formatting errors.
modified:
  libamf/amf.cpp
=== modified file 'libamf/amf.cpp'
--- a/libamf/amf.cpp    2009-03-14 00:32:20 +0000
+++ b/libamf/amf.cpp    2009-03-26 16:47:43 +0000
@@ -953,6 +953,11 @@
     ++tmpptr;
 
     switch (type) {
+        case Element::NOTYPE:
+        {
+           log_error("Element has no type!");
+           break;
+       }
         case Element::NUMBER_AMF0:
         {
             // Make sure this isn't less than 0. We check this above at
@@ -1234,13 +1239,13 @@
     // length to a value, this is tottaly bogus, and I'm tired of
     // braindamaging code to keep valgrind happy.
     if (length <= 0) {
-    log_debug("No Property name, object done");
-    return el;
+//     log_debug("No Property name, object done %x, %x", (void *)in, (void 
*)tooFar);
+       return el;
     }
     
     if (length + tmpptr > tooFar) {
-    log_error("%d bytes for a string is over the safe limit of %d. Putting the 
rest of the buffer into the string, line %d", length, SANE_STR_SIZE, __LINE__);
-    length = tooFar - tmpptr;
+       log_error("%d bytes for a string is over the safe limit of %d. Putting 
the rest of the buffer into the string, line %d", length, SANE_STR_SIZE, 
__LINE__);
+       length = tooFar - tmpptr;
     }    
     
     // name is just debugging help to print cleaner, and should be removed 
later
@@ -1249,7 +1254,7 @@
 //    log_debug(_("AMF property name is: %s"), name);
     // Don't read past the end
     if (tmpptr + length < tooFar) {
-    tmpptr += length;
+       tmpptr += length;
     }
     
     char c = *(reinterpret_cast<char *>(tmpptr));
@@ -1257,21 +1262,21 @@
     // If we get a NULL object, there is no data. In that case, we only return
     // the name of the property.
     if (type == Element::NULL_AMF0) {
-    log_debug("No data associated with Property \"%s\"", name);
-    el.reset(new Element);
-    el->setName(name.c_str(), name.size());
-    tmpptr += 1;
-    // Calculate the offset for the next read
+       log_debug("No data associated with Property \"%s\"", name);
+       el.reset(new Element);
+       el->setName(name.c_str(), name.size());
+       tmpptr += 1;
+       // Calculate the offset for the next read
     } else {
-    // process the data with associated with the property.
-    // Go past the data to the start of the next AMF object, which
-    // should be a type byte.
+       // process the data with associated with the property.
+       // Go past the data to the start of the next AMF object, which
+       // should be a type byte.
 //     tmpptr += length;
-    el = extractAMF(tmpptr, tooFar);
-    if (el) {
-        el->setName(name.c_str(), name.size()); // FIXME: arg, overwrites the 
name for TypedObjects
-    }
-    tmpptr += totalsize();
+       el = extractAMF(tmpptr, tooFar);
+       if (el) {
+           el->setName(name.c_str(), name.size()); // FIXME: arg, overwrites 
the name for TypedObjects
+       }
+       tmpptr += totalsize();
     }
 
     //delete name;


reply via email to

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