diff --git a/libavformat/mov.c b/libavformat/mov.c index 85cb1961d7..e8d0651ef8 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -296,6 +296,8 @@ static int mov_metadata_hmmt(MOVContext *c, AVIOContext *pb, unsigned len) int moment_time = avio_rb32(pb); avpriv_new_chapter(c->fc, i, av_make_q(1, 1000), moment_time, AV_NOPTS_VALUE, NULL); } + if (avio_feof(pb)) + return AVERROR_INVALIDDATA; return 0; }