[FFmpeg-cvslog] lavf: ffio_limit(), treat avio_size()==0 as error.

Michael Niedermayer git at videolan.org
Sat Dec 31 15:58:06 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 31 15:27:51 2011 +0100| [e6362f3a3cfbabf457fc7ebb2205cbfc043501ee] | committer: 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: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6362f3a3cfbabf457fc7ebb2205cbfc043501ee
---

 libavformat/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 7248f91..517b852 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);
         }



More information about the ffmpeg-cvslog mailing list