summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-06-17 21:15:32 +0300
committerMartin Storsjö <martin@martin.st>2012-06-17 22:56:51 +0300
commiteb564b23a3768edea1d8c2d20439e6a4fdea2747 (patch)
treec33c0847aa80500942c84f6839ed69563850af44 /libavformat/http.c
parenteb3918c1fd9a363111457285002eaebbaaa18eed (diff)
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@martin.st>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index b2f2ea97f2..2b5f2cc53b 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);