Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka-at-google.com@ffmpeg.org>2017-08-20 21:56:47 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-24 13:08:07 +0300
commiteaf231544f2f93b96379af3adb71eb0e5f7c2664 (patch)
treeac577bf6b9a0628069661c69bddc3b29b3850b48
parent05fc22f9f69e56a76a52d5287d966d6d66b55ab2 (diff)
avformat/aviobuf: Fix signed integer overflow in avio_seek()
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 eca2a49716ae1f42804dd3545da2f740edf03250) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/aviobuf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 4e79e3f917..1394e2ae83 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -222,6 +222,8 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
offset1 = pos + (s->buf_ptr - s->buffer);
if (offset == 0)
return offset1;
+ if (offset > INT64_MAX - offset1)
+ return AVERROR(EINVAL);
offset += offset1;
}
if (offset < 0)