From 4ae111cf71e11a78fd00d421abf19ce5df4ab349 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 31 Dec 2011 15:27:51 +0100 Subject: [PATCH] lavf: ffio_limit(), treat avio_size()==0 as error. This works around issues arising from inputs that claim to have a filesize of 0. Reported-by: buzz_ Signed-off-by: Michael Niedermayer (cherry picked from commit e6362f3a3cfbabf457fc7ebb2205cbfc043501ee) Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index b59a69228e..304e3642fa 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -271,7 +271,7 @@ int ffio_limit(AVIOContext *s, int size) if(remaining < size){ int64_t newsize= avio_size(s); if(!s->maxsize || s->maxsizemaxsize= newsize; + s->maxsize= newsize - !newsize; remaining= s->maxsize - avio_tell(s); remaining= FFMAX(remaining, 0); }