diff --git a/libavformat/http.c b/libavformat/http.c index 8fe8d11e1e..00cf295001 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -784,8 +784,9 @@ static int http_read_stream(URLContext *h, uint8_t *buf, int size) av_log(NULL, AV_LOG_TRACE, "Chunked encoding data size: %"PRId64"'\n", s->chunksize); - - if (!s->chunksize) + if (s->chunksize < 0) + return AVERROR_INVALIDDATA; + else if (!s->chunksize) return 0; break; }