--- libavformat/mov.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
To be squashed in the mov patch (3/5) Vittorio diff --git a/libavformat/mov.c b/libavformat/mov.c index be09373..fe1f264 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3674,19 +3674,21 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) av_log(s, AV_LOG_TRACE, "stream %d, pts %"PRId64", dts %"PRId64", pos 0x%"PRIx64", duration %"PRId64"\n", pkt->stream_index, pkt->pts, pkt->dts, pkt->pos, pkt->duration); - /* Multiple stsd handling. - * Keep track of the stsc index for the given sample, then check - * if the stsd index is different from the last used one. */ - sc->stsc_sample++; - if (sc->stsc_index < sc->stsc_count && - mov_get_stsc_samples(sc, sc->stsc_index) == sc->stsc_sample) { - sc->stsc_index++; - sc->stsc_sample = 0; - /* Do not check indexes after a switch. */ - } else if (sc->stsc_data[sc->stsc_index].id - 1 != sc->last_stsd_index) { - ret = mov_change_extradata(sc, pkt); - if (ret < 0) - return ret; + /* Multiple stsd handling. */ + if (sc->stsc_data) { + /* Keep track of the stsc index for the given sample, then check + * if the stsd index is different from the last used one. */ + sc->stsc_sample++; + if (sc->stsc_index < sc->stsc_count && + mov_get_stsc_samples(sc, sc->stsc_index) == sc->stsc_sample) { + sc->stsc_index++; + sc->stsc_sample = 0; + /* Do not check indexes after a switch. */ + } else if (sc->stsc_data[sc->stsc_index].id - 1 != sc->last_stsd_index) { + ret = mov_change_extradata(sc, pkt); + if (ret < 0) + return ret; + } } return 0; -- 2.8.3 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel