Commit 4400385d authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mov: fix integer overflow of size

Fixes: case1_call_stack_overflow.mp4
Found-by: 's avatarMichal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be9ce6e1)
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d85e25fe
......@@ -1550,7 +1550,7 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb,
AVStream *st, MOVStreamContext *sc,
int size)
int64_t size)
{
// ttxt stsd contains display flags, justification, background
// color, fonts, and default styles, so fake an atom to read it
......@@ -1615,10 +1615,10 @@ static int mov_rewrite_dvd_sub_extradata(AVStream *st)
static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
AVStream *st, MOVStreamContext *sc,
int size)
int64_t size)
{
if (st->codec->codec_tag == MKTAG('t','m','c','d')) {
if (ff_get_extradata(st->codec, pb, size) < 0)
if ((int)size != size || ff_get_extradata(st->codec, pb, size) < 0)
return AVERROR(ENOMEM);
if (size > 16) {
MOVStreamContext *tmcd_ctx = st->priv_data;
......
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