Fix rare infinite loop on EOF
authorHoward Chu <hyc@highlandsun.com>
Tue, 30 Oct 2012 15:28:15 +0000 (08:28 -0700)
committerHoward Chu <hyc@highlandsun.com>
Tue, 30 Oct 2012 15:28:15 +0000 (08:28 -0700)
reported by Matt Robison <rtmpdump@nerdoftheherd.com>

rtmpdump.c

index 2b30eb2..13741a7 100644 (file)
@@ -580,12 +580,14 @@ Download(RTMP * rtmp,             // connected RTMP object
                }
            }
        }
-#ifdef _DEBUG
       else
        {
+#ifdef _DEBUG
          RTMP_Log(RTMP_LOGDEBUG, "zero read!");
-       }
 #endif
+         if (rtmp->m_read.status == RTMP_READ_EOF)
+           break;
+       }
 
     }
   while (!RTMP_ctrlC && nRead > -1 && RTMP_IsConnected(rtmp) && !RTMP_IsTimedout(rtmp));