mirror of https://git.ffmpeg.org/ffmpeg.git
matroskadec: check element size against stream limit in ebml_parse_elem()
Fixes Ticket1195 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d673a3f4a9
commit
668c873bed
|
@ -945,7 +945,10 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
|
|||
return ebml_parse_nest(matroska, syntax->def.n, data);
|
||||
case EBML_PASS: return ebml_parse_id(matroska, syntax->def.n, id, data);
|
||||
case EBML_STOP: return 1;
|
||||
default: return avio_skip(pb,length)<0 ? AVERROR(EIO) : 0;
|
||||
default:
|
||||
if(ffio_limit(pb, length) != length)
|
||||
return AVERROR(EIO);
|
||||
return avio_skip(pb,length)<0 ? AVERROR(EIO) : 0;
|
||||
}
|
||||
if (res == AVERROR_INVALIDDATA)
|
||||
av_log(matroska->ctx, AV_LOG_ERROR, "Invalid element\n");
|
||||
|
|
Loading…
Reference in New Issue