Commit fd30e4d5 authored by Matt Wolenetz's avatar Matt Wolenetz Committed by Michael Niedermayer

lavf/mov.c: Avoid heap allocation wrap in mov_read_hdlr

Core of patch is from paul@paulmehta.com
Reference https://crbug.com/643950Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Check value reduced as the code does not support larger lengths
parent 1835ed19
......@@ -742,6 +742,8 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
title_size = atom.size - 24;
if (title_size > 0) {
if (title_size > FFMIN(INT_MAX, SIZE_MAX-1))
return AVERROR_INVALIDDATA;
title_str = av_malloc(title_size + 1); /* Add null terminator */
if (!title_str)
return AVERROR(ENOMEM);
......
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