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:
authorMatt Wolenetz <wolenetz@google.com>2016-12-15 02:27:49 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-02-10 14:16:24 +0300
commitc63e58756699d07b5bc69799db388600d3e634bf (patch)
tree3175e4471f15ab0500b5fe58be69701ed173514d
parentb5c13002d18e8cd0ab19b37bb1fff3ea75ec3e5e (diff)
lavf/mov.c: Avoid heap allocation wraps in mov_read_{senc,saiz}()n3.0.7
Core of patch is from paul@paulmehta.com Reference https://crbug.com/643952 (senc,saiz portions) Signed-off-by: Matt Wolenetz <wolenetz@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 36aba43bd5fae8595dd9a566fbcfbbea63f0fca3) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6fc792f0b7..b06e9c84ae 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4064,8 +4064,8 @@ static int mov_read_senc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_rb32(pb); /* entries */
- if (atom.size < 8) {
- av_log(c->fc, AV_LOG_ERROR, "senc atom size %"PRId64" too small\n", atom.size);
+ if (atom.size < 8 || atom.size > FFMIN(INT_MAX, SIZE_MAX)) {
+ av_log(c->fc, AV_LOG_ERROR, "senc atom size %"PRId64" invalid\n", atom.size);
return AVERROR_INVALIDDATA;
}