Commit ffe915b6 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 22558d6f
...@@ -359,7 +359,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) ...@@ -359,7 +359,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 = FFMIN3(sizeof(str)-1, str_size, atom.size); str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);
......
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