Commit 25312a42 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mov: fix integer overflow in mov_read_udta_string()

Found-by: 's avatarPaul Mehta <paul@paulmehta.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3859868c)
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9143ab0e
...@@ -355,7 +355,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) ...@@ -355,7 +355,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (!key) if (!key)
return 0; return 0;
if (atom.size < 0) if (atom.size < 0 || str_size >= INT_MAX/2)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
str_size_alloc = str_size << 1; // worst-case requirement for output string in case of utf8 coded input str_size_alloc = str_size << 1; // worst-case requirement for output string in case of utf8 coded input
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment