diff --git a/libavformat/mov.c b/libavformat/mov.c index b6cdf3a52a..9e876efc8c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2464,8 +2464,10 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) } if (mov_skip_multiple_stsd(c, pb, st->codecpar->codec_tag, format, - size - (avio_tell(pb) - start_pos))) + size - (avio_tell(pb) - start_pos))) { + sc->stsd_count++; continue; + } sc->pseudo_stream_id = st->codecpar->codec_tag ? -1 : pseudo_stream_id; sc->dref_id= dref_id; @@ -2517,6 +2519,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) av_freep(&st->codecpar->extradata); st->codecpar->extradata_size = 0; } + sc->stsd_count++; } if (pb->eof_reached) @@ -2566,8 +2569,6 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (ret < 0) goto fail; - sc->stsd_count = entries; - /* Restore back the primary extradata. */ av_freep(&st->codecpar->extradata); st->codecpar->extradata_size = sc->extradata_size[0];