diff --git a/libavformat/utils.c b/libavformat/utils.c index 124476ded6..b753598950 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1573,6 +1573,9 @@ int ff_add_index_entry(AVIndexEntry **index_entries, if((unsigned)*nb_index_entries + 1 >= UINT_MAX / sizeof(AVIndexEntry)) return -1; + if(timestamp == AV_NOPTS_VALUE) + return AVERROR(EINVAL); + if (is_relative(timestamp)) //FIXME this maintains previous behavior but we should shift by the correct offset once known timestamp -= RELATIVE_TS_BASE;