1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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 <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-12-31 15:27:51 +01:00
parent 81980bf740
commit e6362f3a3c

View File

@ -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);
}