mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/mov: Discard last STSC if its empty
Fixes: Ticket8508
This commit is contained in:
parent
e057e83a4f
commit
550fa277ef
@ -2677,6 +2677,10 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
sc->stsc_data[i].id < 1) {
|
||||
av_log(c->fc, AV_LOG_WARNING, "STSC entry %d is invalid (first=%d count=%d id=%d)\n", i, sc->stsc_data[i].first, sc->stsc_data[i].count, sc->stsc_data[i].id);
|
||||
if (i+1 >= sc->stsc_count) {
|
||||
if (sc->stsc_data[i].count == 0 && i > 0) {
|
||||
sc->stsc_count --;
|
||||
continue;
|
||||
}
|
||||
sc->stsc_data[i].first = FFMAX(sc->stsc_data[i].first, first_min);
|
||||
if (i > 0 && sc->stsc_data[i].first <= sc->stsc_data[i-1].first)
|
||||
sc->stsc_data[i].first = FFMIN(sc->stsc_data[i-1].first + 1LL, INT_MAX);
|
||||
|
Loading…
Reference in New Issue
Block a user