]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpproto.c
avoid infinite loop at the end of files which are not properly terminated
[ffmpeg] / libavformat / rtpproto.c
index 3708a90fa275fb9c494bae66d27ff6541786808e..870273f8cc7d7115a534e56d55d31734e0cab24c 100644 (file)
@@ -25,7 +25,6 @@
 #include <stdarg.h>
 #include "network.h"
 #include <fcntl.h>
-#include "avstring.h"
 
 #define RTP_TX_BUF_SIZE  (64 * 1024)
 #define RTP_RX_BUF_SIZE  (128 * 1024)
@@ -164,7 +163,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
     if (s->rtcp_hd)
         url_close(s->rtcp_hd);
     av_free(s);
-    return AVERROR_IO;
+    return AVERROR(EIO);
 }
 
 static int rtp_read(URLContext *h, uint8_t *buf, int size)
@@ -183,7 +182,7 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size)
             if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
                 ff_neterrno() == FF_NETERROR(EINTR))
                 continue;
-            return AVERROR_IO;
+            return AVERROR(EIO);
         }
         break;
     }
@@ -207,7 +206,7 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size)
                     if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
                         ff_neterrno() == FF_NETERROR(EINTR))
                         continue;
-                    return AVERROR_IO;
+                    return AVERROR(EIO);
                 }
                 break;
             }
@@ -220,7 +219,7 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size)
                     if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
                         ff_neterrno() == FF_NETERROR(EINTR))
                         continue;
-                    return AVERROR_IO;
+                    return AVERROR(EIO);
                 }
                 break;
             }