summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-23 04:39:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-23 04:39:55 +0200
commit64bf8455442b229f30fa293c927957fea116335f (patch)
tree8f4df16ef88a232874eba2d4e42fa825191d0f1e /libavformat/mov.c
parent220df143b962dd8ed65cee90bcff8565a28ee0e6 (diff)
avformat/mov: Dont blindly trust the stream duration in seting chapter times
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 26fb0ed2b4..7f72db973b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3303,6 +3303,11 @@ static void mov_read_chapters(AVFormatContext *s)
uint16_t ch;
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) {
av_log(s, AV_LOG_ERROR, "Chapter %d not found in file\n", i);
goto finish;