1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-09 14:14:39 +02:00

avformat/mov: check that iloc offset values fit on an int64_t

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-06-30 23:40:19 -03:00
parent 4a2de380b7
commit c49898a6b1

View File

@ -8362,7 +8362,7 @@ static int mov_read_SAND(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
}
static int rb_size(AVIOContext *pb, uint64_t* value, int size)
static int rb_size(AVIOContext *pb, int64_t *value, int size)
{
if (size == 0)
*value = 0;
@ -8372,9 +8372,11 @@ static int rb_size(AVIOContext *pb, uint64_t* value, int size)
*value = avio_rb16(pb);
else if (size == 4)
*value = avio_rb32(pb);
else if (size == 8)
else if (size == 8) {
*value = avio_rb64(pb);
else
if (*value < 0)
return -1;
} else
return -1;
return size;
}