summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2019-07-20 23:44:14 +0530
committerGyan Doshi <ffmpeg@gyani.pro>2019-07-22 22:38:09 +0530
commitd51d71c1e3a6a225a5bc8f35963b50331e479b1a (patch)
tree0c20fee9f5cda4365e32c45fe57b390a34fcb3de /libavformat/mov.c
parent817235b195f55746893629bd8e6fa3501ea7b38e (diff)
avformat/mov: fix return code for trun box with no sample entries
A value of zero for sample_count in trun box is not prohibited by 14496-12 section 8.8.8. 4a9d32baca disallowed this which led the demuxer to error out when reading the header of valid files.
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 327a25bbdf..24de5429d1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4781,8 +4781,8 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
entries = UINT_MAX / sizeof(AVIndexEntry) - st->nb_index_entries;
av_log(c->fc, AV_LOG_ERROR, "Failed to add index entry\n");
}
- if (entries <= 0)
- return -1;
+ if (entries == 0)
+ return 0;
requested_size = (st->nb_index_entries + entries) * sizeof(AVIndexEntry);
new_entries = av_fast_realloc(st->index_entries,