diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-31 15:27:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-03 22:44:34 +0100 |
commit | 4ae111cf71e11a78fd00d421abf19ce5df4ab349 (patch) | |
tree | 16ac8eb052f2bfaa7186db6b730b1d148c61657e | |
parent | 0bf48d24d7f220b70f5968b8f691abf2f7a398b3 (diff) | |
download | ffmpeg-4ae111cf71e11a78fd00d421abf19ce5df4ab349.tar.gz |
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>
(cherry picked from commit e6362f3a3cfbabf457fc7ebb2205cbfc043501ee)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
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->maxsize<newsize) - s->maxsize= newsize; + s->maxsize= newsize - !newsize; remaining= s->maxsize - avio_tell(s); remaining= FFMAX(remaining, 0); } |