rtspdec: Fix use of uninitialized byte
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 11 Oct 2012 21:57:08 +0000 (23:57 +0200)
committerMartin Storsjö <martin@martin.st>
Fri, 12 Oct 2012 15:16:57 +0000 (18:16 +0300)
ffurl_read_complete can return 0 as well as negative error codes.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtspdec.c

index 7476c45ba85d29956ad94d204627969de175d05e..d46f1a4872e638be3d8db9606e8f6524748bc28b 100644 (file)
@@ -76,8 +76,8 @@ static inline int read_line(AVFormatContext *s, char *rbuf, const int rbufsize,
 
     do {
         ret = ffurl_read_complete(rt->rtsp_hd, rbuf + idx, 1);
-        if (ret < 0)
-            return ret;
+        if (ret <= 0)
+            return ret ? ret : AVERROR_EOF;
         if (rbuf[idx] == '\r') {
             /* Ignore */
         } else if (rbuf[idx] == '\n') {