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

Showing the changes to libavformat (1 of 1 file). Show all

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
259259 offset1 = pos + (s->buf_ptr - s->buffer);
260260 if (offset == 0)
261261 return offset1;
262+ if (offset > INT64_MAX - offset1)
263+ return AVERROR(EINVAL);
262264 offset += offset1;
263265 }
264266 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