mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avformat/mov: fix integer overflow of size
Fixes: case1_call_stack_overflow.mp4 Found-by: Michal Zalewski <lcamtuf@coredump.cx> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
caa7a3914f
commit
be9ce6e10a
@ -1574,7 +1574,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
|
||||
@ -1639,10 +1639,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user