MvH
Benjamin Larsson
>From 2a63b73f481dadf5359c825babcef6807ae97f4b Mon Sep 17 00:00:00 2001
From: Benjamin Larsson <[email protected]>
Date: Sat, 29 Oct 2011 12:57:10 +0200
Subject: [PATCH] mov: Avoid divide by zero in edit list dts handling

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1747bd4..2036f51 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1605,7 +1605,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
         if (sc->time_offset < 0)
             sc->time_offset = av_rescale(sc->time_offset, sc->time_scale, mov->time_scale);
         current_dts = -sc->time_offset;
-        if (sc->ctts_data && sc->stts_data &&
+        if (sc->ctts_data && sc->stts_data && sc->stts_data[0].duration &&
             sc->ctts_data[0].duration / sc->stts_data[0].duration > 16) {
             /* more than 16 frames delay, dts are likely wrong
                this happens with files created by iMovie */
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to