History

avformat/mov: Fix signed integer overflows with total_size

Signed integer overflow is undefined behavior. Detected with clang and -fsanitize=signed-integer-overflow

Vitaly Buka committed 9 years ago

Commit 4a404cb1 parent 8c2bb101 file · +1 −1Browse files

Unified · Split

libavformat/mov.c+1−1
@@ -5572,7 +5572,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 5571 unmodified lines
55725572
55735573 if (atom.size < 0)
55745574 atom.size = INT64_MAX;
5575− while (total_size + 8 <= atom.size && !avio_feof(pb)) {
5575+ while (total_size <= atom.size - 8 && !avio_feof(pb)) {
55765576 int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
55775577 a.size = atom.size;
55785578 a.type=0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t