X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=mp4.c;fp=mp4.c;h=9e33eb4c298e49ad5fd2f8ed40824200966e1d03;hb=0c913731ca6a1f65b52f47f8797bb6031cb7523b;hp=e60f18f59b1adc26350ae25055df7c822f6f174c;hpb=1182720326e0392271fa66fe582d5c2be108877b;p=paraslash.git diff --git a/mp4.c b/mp4.c index e60f18f5..9e33eb4c 100644 --- a/mp4.c +++ b/mp4.c @@ -629,6 +629,9 @@ int mp4_open_read(const struct mp4_callback *cb, struct mp4 **result) ret = -E_MP4_BAD_SAMPLE_COUNT; if (f->track.stsz_sample_count == 0) goto fail; + ret = -E_MP4_CORRUPT; + if (f->track.time_scale == 0) + goto fail; *result = f; return 1; fail: @@ -666,8 +669,6 @@ uint64_t mp4_get_duration(const struct mp4 *f) { const struct mp4_track *t = &f->track; - if (t->time_scale == 0) - return 0; return t->duration * 1000 / t->time_scale; }