Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index db2ca565fb..7248f91b86 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -276,9 +276,10 @@ int ffio_limit(AVIOContext *s, int size)
if(!s->maxsize || s->maxsize<newsize)
s->maxsize= newsize;
remaining= s->maxsize - avio_tell(s);
+ remaining= FFMAX(remaining, 0);
}
- if(s->maxsize>=0 && remaining>=0 && remaining+1 < size){
+ if(s->maxsize>=0 && remaining+1 < size){
av_log(0, AV_LOG_ERROR, "Truncating packet of size %d to %"PRId64"\n", size, remaining+1);
size= remaining+1;
}