diff options
author | Dale Curtis <dalecurtis@chromium.org> | 2015-01-05 16:34:17 -0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-13 17:06:08 +0100 |
commit | 3eee7e0db60dc2d3756bde814f21f3df72eb0b0b (patch) | |
tree | 1da46e17cdcc26fe48da8c99a6d10baec5853002 | |
parent | e2e66f2f998242c7a9342df6d68f9a98fda774c9 (diff) | |
download | ffmpeg-3eee7e0db60dc2d3756bde814f21f3df72eb0b0b.tar.gz |
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@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ebd76a9c57558e284e94da367dd23b435e6a6d0)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mov.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index df3dc39f8c..c55834e838 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2836,7 +2836,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; } |