History

avformat/mov: simplify the entry count overflow check in the keys atom

James Almer committed 2 years ago

Commit 8e294ab1 parent 5a06d381 file · +1 −1Browse files

Unified · Split

libavformat/mov.c+1−1
@@ -5025,7 +5025,7 @@ static int mov_read_keys(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 5024 unmodified lines
50255025 avio_skip(pb, 4);
50265026 count = avio_rb32(pb);
50275027 atom.size -= 8;
5028− if (count > UINT_MAX / sizeof(*c->meta_keys) - 1) {
5028+ if (count >= UINT_MAX / sizeof(*c->meta_keys)) {
50295029 av_log(c->fc, AV_LOG_ERROR,
50305030 "The 'keys' atom with the invalid key count: %"PRIu32"\n", count);
50315031 return AVERROR_INVALIDDATA;

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