mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-30 11:22:14 +00:00
avformat/matroskadec: Check parents remaining length
This was found through the Hacker One program on VLC but is not a security issue in libavformat Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
b687b549aa
commit
9326117bf6
@ -1197,6 +1197,18 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
|
||||
length, max_lengths[syntax->type], syntax->type);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (matroska->num_levels > 0) {
|
||||
MatroskaLevel *level = &matroska->levels[matroska->num_levels - 1];
|
||||
AVIOContext *pb = matroska->ctx->pb;
|
||||
int64_t pos = avio_tell(pb);
|
||||
if (level->length != (uint64_t) -1 &&
|
||||
(pos + length) > (level->start + level->length)) {
|
||||
av_log(matroska->ctx, AV_LOG_ERROR,
|
||||
"Invalid length 0x%"PRIx64" > 0x%"PRIx64" in parent\n",
|
||||
length, level->start + level->length);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (syntax->type) {
|
||||
|
Loading…
Reference in New Issue
Block a user