From e6362f3a3cfbabf457fc7ebb2205cbfc043501ee 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 --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 7248f91b86..517b8525d9 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -274,7 +274,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); }