matroska: pass the lace size to the matroska_parse_rm_audio
Each lace must be independent according to the specification. Fix heap-buffer-overflow in matroska_parse_block for corrupted real media in mkv files. Stricter check thanfc43c19a56
CC: libav-stable@libav.org (cherry picked from commit25a80a931a
) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:

committed by
Reinhard Tartler

parent
b90816d94b
commit
09e391abd8
@@ -2081,7 +2081,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
||||
st->codec->codec_id == AV_CODEC_ID_ATRAC3) &&
|
||||
st->codec->block_align && track->audio.sub_packet_size) {
|
||||
|
||||
res = matroska_parse_rm_audio(matroska, track, st, data, size,
|
||||
res = matroska_parse_rm_audio(matroska, track, st, data,
|
||||
lace_size[n],
|
||||
timecode, duration, pos);
|
||||
if (res)
|
||||
goto end;
|
||||
@@ -2097,7 +2098,6 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
||||
if (timecode != AV_NOPTS_VALUE)
|
||||
timecode = duration ? timecode + duration : AV_NOPTS_VALUE;
|
||||
data += lace_size[n];
|
||||
size -= lace_size[n];
|
||||
}
|
||||
|
||||
end:
|
||||
|
Reference in New Issue
Block a user