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
8137 size -= 4;8137 size -= 4;
8138 8138
8139 if (version < 2) {8139 if (version < 2) {
8140 av_log(c->fc, AV_LOG_ERROR, "infe: version < 2 not supported\n");8140 avpriv_report_missing_feature(c->fc, "infe version < 2");
8141 return AVERROR_PATCHWELCOME;8141 return 1;
8142 }8142 }
8143 8143
8144 item_id = version > 2 ? avio_rb32(pb) : avio_rb16(pb);8144 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
8209 ret = mov_read_infe(c, pb, infe, i);8209 ret = mov_read_infe(c, pb, infe, i);
8210 if (ret < 0)8210 if (ret < 0)
8211 return ret;8211 return ret;
8212 if (ret)
8213 return 0;
8212 }8214 }
8213 8215
8214 c->found_iinf = 1;8216 c->found_iinf = 1;
@@ -9508,14 +9510,15 @@ static int mov_read_header(AVFormatContext *s) · 1293 unmodified lines
9508 av_log(s, AV_LOG_ERROR, "error reading header\n");9510 av_log(s, AV_LOG_ERROR, "error reading header\n");
9509 return err;9511 return err;
9510 }9512 }
9511 } while ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !mov->found_moov && !mov->found_iloc && !mov->moov_retry++);9513 } while ((pb->seekable & AVIO_SEEKABLE_NORMAL) &&
9512 if (!mov->found_moov && !mov->found_iloc) {9514 !mov->found_moov && (!mov->found_iloc || !mov->found_iinf) && !mov->moov_retry++);
9515 if (!mov->found_moov && !mov->found_iloc && !mov->found_iinf) {
9513 av_log(s, AV_LOG_ERROR, "moov atom not found\n");9516 av_log(s, AV_LOG_ERROR, "moov atom not found\n");
9514 return AVERROR_INVALIDDATA;9517 return AVERROR_INVALIDDATA;
9515 }9518 }
9516 av_log(mov->fc, AV_LOG_TRACE, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb));9519 av_log(mov->fc, AV_LOG_TRACE, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb));
9517 9520
9518 if (mov->found_iloc) {9521 if (mov->found_iloc && mov->found_iinf) {
9519 for (i = 0; i < mov->nb_heif_item; i++) {9522 for (i = 0; i < mov->nb_heif_item; i++) {
9520 HEIFItem *item = &mov->heif_item[i];9523 HEIFItem *item = &mov->heif_item[i];
9521 MOVStreamContext *sc;9524 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