History

avformat/mov: Discard last STSC if its empty

Michael Niedermayer committed 6 years ago

Commit 550fa271 parent e057e831 file · +4 −0Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/mov.c+4−0
@@ -2677,6 +2677,10 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 2676 unmodified lines
2677 sc->stsc_data[i].id < 1) {2677 sc->stsc_data[i].id < 1) {
2678 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);2678 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);
2679 if (i+1 >= sc->stsc_count) {2679 if (i+1 >= sc->stsc_count) {
2680 if (sc->stsc_data[i].count == 0 && i > 0) {
2681 sc->stsc_count --;
2682 continue;
2683 }
2680 sc->stsc_data[i].first = FFMAX(sc->stsc_data[i].first, first_min);2684 sc->stsc_data[i].first = FFMAX(sc->stsc_data[i].first, first_min);
2681 if (i > 0 && sc->stsc_data[i].first <= sc->stsc_data[i-1].first)2685 if (i > 0 && sc->stsc_data[i].first <= sc->stsc_data[i-1].first)
2682 sc->stsc_data[i].first = FFMIN(sc->stsc_data[i-1].first + 1LL, INT_MAX);2686 sc->stsc_data[i].first = FFMIN(sc->stsc_data[i-1].first + 1LL, INT_MAX);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t