History

avformat/aviobuf: Fix signed integer overflow in avio_seek()

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

Vitaly Buka committed 9 years ago

Commit eca2a491 parent 4a404cb1 file · +2 −0Browse files

Unified · Split

libavformat/aviobuf.c+2−0
@@ -259,6 +259,8 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence) · 258 unmodified lines
259 offset1 = pos + (s->buf_ptr - s->buffer);259 offset1 = pos + (s->buf_ptr - s->buffer);
260 if (offset == 0)260 if (offset == 0)
261 return offset1;261 return offset1;
262 if (offset > INT64_MAX - offset1)
263 return AVERROR(EINVAL);
262 offset += offset1;264 offset += offset1;
263 }265 }
264 if (offset < 0)266 if (offset < 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