Commit e6362f3a authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 81980bf7
......@@ -274,7 +274,7 @@ int ffio_limit(AVIOContext *s, int size)
if(remaining < size){
int64_t newsize= avio_size(s);
if(!s->maxsize || s->maxsize<newsize)
s->maxsize= newsize;
s->maxsize= newsize - !newsize;
remaining= s->maxsize - avio_tell(s);
remaining= FFMAX(remaining, 0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment