[FFmpeg-cvslog] http: Fail reading if the connection has gone away
Martin Storsjö
git at videolan.org
Mon Jun 18 20:25:39 CEST 2012
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sun Jun 17 21:15:32 2012 +0300| [eb564b23a3768edea1d8c2d20439e6a4fdea2747] | committer: Martin Storsjö
http: Fail reading if the connection has gone away
This can happen if doing a new request using the same socket,
but the new request failed, which clears the urlcontext.
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eb564b23a3768edea1d8c2d20439e6a4fdea2747
---
libavformat/http.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/http.c b/libavformat/http.c
index b2f2ea9..2b5f2cc 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -510,6 +510,9 @@ static int http_read(URLContext *h, uint8_t *buf, int size)
HTTPContext *s = h->priv_data;
int err, new_location;
+ if (!s->hd)
+ return AVERROR_EOF;
+
if (s->end_chunked_post) {
if (!s->end_header) {
err = http_read_header(h, &new_location);
More information about the ffmpeg-cvslog
mailing list