[FFmpeg-devel] [PATCH] lavf/http.c: Don't write chunked-transfer-trailer to listening server context.

Stephan Holljes klaxa1337 at googlemail.com
Thu Apr 12 03:07:51 EEST 2018


---
I found this bug while working on my qualification task. When closing
a listening HTTP AVIOContext http_shutdown() tries to write the
chunked-transfer-encoding trailer to the listening Context.

 libavformat/http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 983034f083..248fa085bf 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1623,7 +1623,7 @@ static int http_shutdown(URLContext *h, int flags)
     HTTPContext *s = h->priv_data;
 
     /* signal end of chunked encoding if used */
-    if (((flags & AVIO_FLAG_WRITE) && s->chunked_post) ||
+    if (((flags & AVIO_FLAG_WRITE) && s->chunked_post && !s->listen) ||
         ((flags & AVIO_FLAG_READ) && s->chunked_post && s->listen)) {
         ret = ffurl_write(s->hd, footer, sizeof(footer) - 1);
         ret = ret > 0 ? 0 : ret;
-- 
2.16.2



More information about the ffmpeg-devel mailing list