mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
lavf/mov.c: Avoid heap allocation wrap in mov_read_hdlr
Core of patch is from paul@paulmehta.com
Reference https://crbug.com/643950
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Check value reduced as the code does not support larger lengths
(cherry picked from commit fd30e4d57f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
142c1737e3
commit
8be3724e55
@@ -635,6 +635,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);
|
||||
|
||||
Reference in New Issue
Block a user