summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-07-15 15:59:50 +0300
committerMartin Storsjö <martin@martin.st>2013-07-15 21:37:44 +0300
commit5b4eb243bce10a3e8345401a353749e0414c54ca (patch)
tree426001d05791ce0298acf47f1a8567257b78aff9
parent8f24c12be7a3b3ea105e67bba9a867fe210a2333 (diff)
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>
-rw-r--r--libavformat/mov.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2d87a0861e..b33b30db34 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2592,6 +2592,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;