[rtmpdump] Wrong switch expression in RTMP_Read

Mikhail I. Izmestev izmmishao5 at gmail.com
Fri Jun 25 18:36:15 CEST 2010


 Hi all.

There is oblivious bug in RTMP_Read. At changeset 477:
<code>
@@ -4039,8 +4039,17 @@
   int nRead = 0, total = 0;
 
   /* can't continue */
-  if (r->m_read.status < 0)
+fail:
+  switch (r->m_read.status < 0) {
+  case RTMP_READ_EOF:
+  case RTMP_READ_COMPLETE:
+    return 0;
+  case RTMP_READ_ERROR:  /* corrupted stream, resume failed */
+    SetSockError(EINVAL);
     return -1;
+  default:
+    break;
+  }
 
   /* first time thru */
   if (!(r->m_read.flags & RTMP_READ_HEADER))
</code>

Maybe switch should be like:
<code>
switch (r->m_read.status)
</code>

Mikhail.



More information about the rtmpdump mailing list