aboutsummaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer2011-12-31 15:27:51 +0100
committerMichael Niedermayer2011-12-31 15:35:39 +0100
commite6362f3a3cfbabf457fc7ebb2205cbfc043501ee (patch)
tree360df5f1fb0005c5180fb8dc9436bf356d1af3de /libavformat/utils.c
parent81980bf740f3b3d14efe8ee96cf54edbc5e1f063 (diff)
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>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
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->maxsize<newsize)
- s->maxsize= newsize;
+ s->maxsize= newsize - !newsize;
remaining= s->maxsize - avio_tell(s);
remaining= FFMAX(remaining, 0);
}