1--- mp4v2-r355/src/mp4track.cpp 2012-01-05 15:44:29.000000000 +0100
2+++ mp4v2-r355/src/mp4track.cpp 2012-01-05 15:47:34.000000000 +0100
3@@ -819,13 +819,14 @@
4 (thisSecStart + timeScale) - lastSampleTime;
5 // calculate the duration of the last sample
6 MP4Duration lastSampleDur = sampleTime - lastSampleTime;
7- uint32_t overflow_bytes;
8 // now, calculate the number of bytes we overflowed. Round up.
9- overflow_bytes =
10- ((lastSampleSize * overflow_dur) + (lastSampleDur - 1)) / lastSampleDur;
11+ if( lastSampleDur > 0 ) {
12+ uint32_t overflow_bytes = 0;
13+ overflow_bytes = ((lastSampleSize * overflow_dur) + (lastSampleDur - 1)) / lastSampleDur;
14
15- if (bytesThisSec - overflow_bytes > maxBytesPerSec) {
16- maxBytesPerSec = bytesThisSec - overflow_bytes;
17+ if (bytesThisSec - overflow_bytes > maxBytesPerSec) {
18+ maxBytesPerSec = bytesThisSec - overflow_bytes;
19+ }
20 }
21
22 // now adjust the values for this sample. Remove the bytes