mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/mov: Dont blindly trust the stream duration in seting chapter times
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
220df143b9
commit
64bf845544
|
@ -3303,6 +3303,11 @@ static void mov_read_chapters(AVFormatContext *s)
|
||||||
uint16_t ch;
|
uint16_t ch;
|
||||||
int len, title_len;
|
int len, title_len;
|
||||||
|
|
||||||
|
if (end < sample->timestamp) {
|
||||||
|
av_log(s, AV_LOG_WARNING, "ignoring stream duration which is shorter than chapters\n");
|
||||||
|
end = AV_NOPTS_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (avio_seek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {
|
if (avio_seek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {
|
||||||
av_log(s, AV_LOG_ERROR, "Chapter %d not found in file\n", i);
|
av_log(s, AV_LOG_ERROR, "Chapter %d not found in file\n", i);
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
Loading…
Reference in New Issue