[FFmpeg-cvslog] mov: Fix negative size calculation in mov_read_default().

Dale Curtis git at videolan.org
Fri Jan 9 17:32:16 CET 2015


ffmpeg | branch: release/2.5 | Dale Curtis <dalecurtis at chromium.org> | Mon Jan  5 16:34:17 2015 -0800| [0ce35b8ce8b9e06a4dedc62b4fe10261db67f0a3] | committer: Michael Niedermayer

mov: Fix negative size calculation in mov_read_default().

The previous code assumed if an atom was marked with a 64-bit
size extension, it actually had that data available. The new
code verfies there's enough data in the atom for this to be
done.

Failure to verify causes total_size > atom.size which will
result in negative size calculations later on.

Found-by: Paul Mehta <paul at paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis at chromium.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 3ebd76a9c57558e284e94da367dd23b435e6a6d0)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/mov.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 11fdcf0..47f0073 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3431,7 +3431,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
                 }
             }
             total_size += 8;
-            if (a.size == 1) { /* 64 bit extended size */
+            if (a.size == 1 && total_size + 8 <= atom.size) { /* 64 bit extended size */
                 a.size = avio_rb64(pb) - 8;
                 total_size += 8;
             }



More information about the ffmpeg-cvslog mailing list