[FFmpeg-trac] #861(avformat:new): problem with ffio_limit
FFmpeg
trac at avcodec.org
Sat Dec 31 07:16:20 CET 2011
#861: problem with ffio_limit
-------------------------------------+------------------------------------
Reporter: exobuzz | Owner:
Type: defect | Status: new
Priority: normal | Component: avformat
Version: unspecified | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+------------------------------------
Comment (by exobuzz):
something like this would also fix it - I was thinking that the
calculation "int64_t remaining= s->maxsize - avio_tell(s);" shouldn't be
done anyway if maxsize is 0?
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 7248f91..1629c32 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -269,7 +269,7 @@ AVInputFormat *av_find_input_format(const char
*short_name)
int ffio_limit(AVIOContext *s, int size)
{
- if(s->maxsize>=0){
+ if(s->maxsize>0){
int64_t remaining= s->maxsize - avio_tell(s);
if(remaining < size){
int64_t newsize= avio_size(s);
or perhaps to check both maxsize and avio_size are greater than 0 ?
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/861#comment:2>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list