[FFmpeg-cvslog] lavf/mov.c: Avoid heap allocation wraps in mov_read_{senc, saiz}()

Matt Wolenetz git at videolan.org
Sat Feb 11 13:49:27 EET 2017


ffmpeg | branch: release/3.0 | Matt Wolenetz <wolenetz at google.com> | Wed Dec 14 15:27:49 2016 -0800| [c63e58756699d07b5bc69799db388600d3e634bf] | committer: Michael Niedermayer

lavf/mov.c: Avoid heap allocation wraps in mov_read_{senc,saiz}()

Core of patch is from paul at paulmehta.com
Reference https://crbug.com/643952 (senc,saiz portions)

Signed-off-by: Matt Wolenetz <wolenetz at chromium.org>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 36aba43bd5fae8595dd9a566fbcfbbea63f0fca3)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c63e58756699d07b5bc69799db388600d3e634bf
---

 libavformat/mov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6fc792f..b06e9c8 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;
     }
 



More information about the ffmpeg-cvslog mailing list