diff options
author | Matt Wolenetz <wolenetz@google.com> | 2016-12-14 15:26:19 -0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-08 03:57:10 +0100 |
commit | 2d453188c2303da641dafb048dc1806790526dfd (patch) | |
tree | bfbf26717badecb802c64baa6ec1e009fa31c3d8 /libavformat | |
parent | fd30e4d57fe5841385f845440688505b88c0f4a9 (diff) | |
download | ffmpeg-streaming-2d453188c2303da641dafb048dc1806790526dfd.zip ffmpeg-streaming-2d453188c2303da641dafb048dc1806790526dfd.tar.gz |
lavf/mov.c: Avoid heap allocation wrap in mov_read_uuid
Core of patch is from paul@paulmehta.com
Reference https://crbug.com/643951
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Check value reduced as the code does not support values beyond INT_MAX
Also the check is moved to a more common place and before integer truncation
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 8c54539..ca49786 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4789,7 +4789,7 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom) 0x88, 0x14, 0x58, 0x7a, 0x02, 0x52, 0x1f, 0xdd, }; - if (atom.size < sizeof(uuid) || atom.size == INT64_MAX) + if (atom.size < sizeof(uuid) || atom.size >= FFMIN(INT_MAX, SIZE_MAX)) return AVERROR_INVALIDDATA; if (c->fc->nb_streams < 1) |