limit chunk size to 1GB

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Maksym Veremeyenko 2012-01-23 13:59:37 +02:00 committed by Michael Niedermayer
parent f7a9b1deee
commit 2aadff2e44
1 changed files with 2 additions and 1 deletions

View File

@ -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{