ismindex: Change the duration field to int64_t
authorMartin Storsjö <martin@martin.st>
Fri, 4 Oct 2013 07:14:49 +0000 (10:14 +0300)
committerMartin Storsjö <martin@martin.st>
Fri, 4 Oct 2013 21:01:28 +0000 (00:01 +0300)
This reduces the risk for overflow in pathlogical cases.

Signed-off-by: Martin Storsjö <martin@martin.st>
tools/ismindex.c

index d5cf1382f8a369400b9bf34ed0279e1e0f2ef73a..a51c5b748fe30083bde12a255fb5e9b3242b0822 100644 (file)
@@ -49,7 +49,7 @@ static int usage(const char *argv0, int ret)
 struct MoofOffset {
     int64_t time;
     int64_t offset;
-    int duration;
+    int64_t duration;
 };
 
 struct Track {
@@ -425,7 +425,7 @@ static void print_track_chunks(FILE *out, struct Tracks *tracks, int main,
                 fprintf(stderr, "Mismatched duration of %s chunk %d in %s and %s\n",
                         type, i, track->name, tracks->tracks[j]->name);
         }
-        fprintf(out, "\t\t<c n=\"%d\" d=\"%d\" />\n",
+        fprintf(out, "\t\t<c n=\"%d\" d=\"%"PRId64"\" />\n",
                 i, track->offsets[i].duration);
     }
 }