[FFmpeg-cvslog] limit chunk size to 1GB

Maksym Veremeyenko git at videolan.org
Tue Jan 24 01:52:54 CET 2012


ffmpeg | branch: master | Maksym Veremeyenko <verem at m1stereo.tv> | Mon Jan 23 13:59:37 2012 +0200| [2aadff2e44fa27664ccd1b0a63829e61bf82e939] | committer: Michael Niedermayer

limit chunk size to 1GB

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2763531..06d18f9 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1948,7 +1948,8 @@ static void build_chunks(MOVTrack *trk)
     chunk->chunkNum= 1;
     trk->chunkCount= 1;
     for(i=1; i<trk->entry; i++){
-        if(chunk->pos + chunkSize == trk->cluster[i].pos){
+        if(chunk->pos + chunkSize == trk->cluster[i].pos &&
+            chunkSize + trk->cluster[i].size < UINT32_MAX / 4){
             chunkSize             += trk->cluster[i].size;
             chunk->samplesInChunk += trk->cluster[i].entries;
         }else{



More information about the ffmpeg-cvslog mailing list