mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avformat/matroskaenc: Check BlockAdditional size before use
Don't read a 64bit number before having checked that the data is at least 8 bytes long. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6e9cc964293bf1e0cca6a52b2938a20d711e4146) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
dace04f5ad
commit
7fb1978249
@ -2154,9 +2154,13 @@ static int mkv_write_block(AVFormatContext *s, AVIOContext *pb,
|
||||
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL,
|
||||
&side_data_size);
|
||||
if (side_data) {
|
||||
additional_id = AV_RB64(side_data);
|
||||
side_data += 8;
|
||||
side_data_size -= 8;
|
||||
if (side_data_size < 8) {
|
||||
side_data_size = 0;
|
||||
} else {
|
||||
additional_id = AV_RB64(side_data);
|
||||
side_data += 8;
|
||||
side_data_size -= 8;
|
||||
}
|
||||
}
|
||||
|
||||
if ((side_data_size && additional_id == 1) || discard_padding) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user