History

avformat/mov: ignore old infe box versions

Some files with no image items have them, and were working prior to the recent HEIF parsing overhaul. Ignore such boxes instead, to recover the old behavior. Fixes a regression since d9fed9df2a9e70c9375d3b2591db35c09303d369.

James Almer committed 2 years ago

Commit 5b9db321 parent 69274571 file · +8 −5Browse files

Unified · Split

libavformat/mov.c+8−5
@@ -8137,8 +8137,8 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, MOVAtom atom, int idx) · 8136 unmodified lines
81378137 size -= 4;
81388138
81398139 if (version < 2) {
8140− av_log(c->fc, AV_LOG_ERROR, "infe: version < 2 not supported\n");
8141− return AVERROR_PATCHWELCOME;
8140+ avpriv_report_missing_feature(c->fc, "infe version < 2");
8141+ return 1;
81428142 }
81438143
81448144 item_id = version > 2 ? avio_rb32(pb) : avio_rb16(pb);
@@ -8209,6 +8209,8 @@ static int mov_read_iinf(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 64 unmodified lines
82098209 ret = mov_read_infe(c, pb, infe, i);
82108210 if (ret < 0)
82118211 return ret;
8212+ if (ret)
8213+ return 0;
82128214 }
82138215
82148216 c->found_iinf = 1;
@@ -9508,14 +9510,15 @@ static int mov_read_header(AVFormatContext *s) · 1293 unmodified lines
95089510 av_log(s, AV_LOG_ERROR, "error reading header\n");
95099511 return err;
95109512 }
9511− } while ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !mov->found_moov && !mov->found_iloc && !mov->moov_retry++);
9512− if (!mov->found_moov && !mov->found_iloc) {
9513+ } while ((pb->seekable & AVIO_SEEKABLE_NORMAL) &&
9514+ !mov->found_moov && (!mov->found_iloc || !mov->found_iinf) && !mov->moov_retry++);
9515+ if (!mov->found_moov && !mov->found_iloc && !mov->found_iinf) {
95139516 av_log(s, AV_LOG_ERROR, "moov atom not found\n");
95149517 return AVERROR_INVALIDDATA;
95159518 }
95169519 av_log(mov->fc, AV_LOG_TRACE, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb));
95179520
9518− if (mov->found_iloc) {
9521+ if (mov->found_iloc && mov->found_iinf) {
95199522 for (i = 0; i < mov->nb_heif_item; i++) {
95209523 HEIFItem *item = &mov->heif_item[i];
95219524 MOVStreamContext *sc;

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