Commit 4af7166f authored by Baptiste Coudurier's avatar Baptiste Coudurier

In mov demuxer, check that stts data exists, fix crash, issue #2479

Originally committed as revision 26227 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 9be52d48
...@@ -1515,7 +1515,8 @@ static void mov_build_index(MOVContext *mov, AVStream *st) ...@@ -1515,7 +1515,8 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
if (sc->time_offset) { if (sc->time_offset) {
int rescaled = sc->time_offset < 0 ? av_rescale(sc->time_offset, sc->time_scale, mov->time_scale) : sc->time_offset; int rescaled = sc->time_offset < 0 ? av_rescale(sc->time_offset, sc->time_scale, mov->time_scale) : sc->time_offset;
current_dts = -rescaled; current_dts = -rescaled;
if (sc->ctts_data && sc->ctts_data[0].duration / sc->stts_data[0].duration > 16) { if (sc->ctts_data && sc->stts_data &&
sc->ctts_data[0].duration / sc->stts_data[0].duration > 16) {
/* more than 16 frames delay, dts are likely wrong /* more than 16 frames delay, dts are likely wrong
this happens with files created by iMovie */ this happens with files created by iMovie */
sc->wrong_dts = 1; sc->wrong_dts = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment