diff options
author | Martin Storsjö <martin@martin.st> | 2013-07-15 15:59:50 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-08-24 12:11:57 +0200 |
commit | 256d61538336973c91c0c0c11c16b30522e12e00 (patch) | |
tree | 739c61f821c4f5c5c3cceca8589df4a75ea5baec | |
parent | 9680f84a31fa97272777e43a9234eb20d6da5930 (diff) | |
download | ffmpeg-256d61538336973c91c0c0c11c16b30522e12e00.tar.gz |
mov: Seek back if overreading an individual atom
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 5b4eb243bce10a3e8345401a353749e0414c54ca)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavformat/mov.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 7fe0548daa..52b73a98e8 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2601,6 +2601,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) left = a.size - avio_tell(pb) + start_pos; if (left > 0) /* skip garbage at atom end */ avio_skip(pb, left); + else if (left < 0) { + av_log(c->fc, AV_LOG_WARNING, + "overread end of atom '%.4s' by %"PRId64" bytes\n", + (char*)&a.type, -left); + avio_seek(pb, left, SEEK_CUR); + } } total_size += a.size; |