diff --git a/libavformat/mov.c b/libavformat/mov.c index 3711d2932e..d7e5669c8e 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -359,7 +359,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (!key) return 0; - if (atom.size < 0) + if (atom.size < 0 || str_size >= INT_MAX/2) return AVERROR_INVALIDDATA; str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);