mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-19 21:06:42 +00:00
avformat/mov: Fix signed integer overflows with total_size
Signed integer overflow is undefined behavior.
Detected with clang and -fsanitize=signed-integer-overflow
Signed-off-by: Vitaly Buka <vitalybuka@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4a404cb5b9
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
ba4b4e4809
commit
ec00cc34c3
@ -3233,7 +3233,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
if (atom.size < 0)
|
if (atom.size < 0)
|
||||||
atom.size = INT64_MAX;
|
atom.size = INT64_MAX;
|
||||||
while (total_size + 8 <= atom.size && !avio_feof(pb)) {
|
while (total_size <= atom.size - 8 && !avio_feof(pb)) {
|
||||||
int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
|
int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
|
||||||
a.size = atom.size;
|
a.size = atom.size;
|
||||||
a.type=0;
|
a.type=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user