[FFmpeg-cvslog] mov: Seek back if overreading an individual atom

Martin Storsjö git at videolan.org
Tue Aug 27 18:38:48 CEST 2013


ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Mon Jul 15 15:59:50 2013 +0300| [256d61538336973c91c0c0c11c16b30522e12e00] | committer: Luca Barbato

mov: Seek back if overreading an individual atom

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Cc: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 5b4eb243bce10a3e8345401a353749e0414c54ca)

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=256d61538336973c91c0c0c11c16b30522e12e00
---

 libavformat/mov.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7fe0548..52b73a9 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;



More information about the ffmpeg-cvslog mailing list