diff --git a/hmmlib2/hmmlib.h b/hmmlib2/hmmlib.h index b35c77f..eee625a 100644 --- a/hmmlib2/hmmlib.h +++ b/hmmlib2/hmmlib.h @@ -696,6 +696,13 @@ static void _hmml_parse_timestamps(struct _hmml_parser* p) } } + for(size_t i = 0; i < ts.reference_count; ++i) { + HMML_Reference* ref = ts.references + i; + if(ref->offset > text_len) { + ref->offset = text_len; + } + } + _hmml_persist_array(p, &p->out.timestamps, &p->out.timestamp_count, ts); } } @@ -813,7 +820,7 @@ void hmml_free(HMML_Output* out) } const struct HMML_Version hmml_version = { - 2, 0, 11 + 2, 0, 12 }; #undef HSTX