Fix heap-buffer-overflow in matroska_parse_block
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81e85bc95c
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
298e03d102
commit
f8d5f3dff5
@@ -1916,10 +1916,10 @@ static void matroska_clear_queue(MatroskaDemuxContext *matroska)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
|
static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
|
||||||
int size, int type,
|
int* buf_size, int type,
|
||||||
uint32_t **lace_buf, int *laces)
|
uint32_t **lace_buf, int *laces)
|
||||||
{
|
{
|
||||||
int res = 0, n;
|
int res = 0, n, size = *buf_size;
|
||||||
uint8_t *data = *buf;
|
uint8_t *data = *buf;
|
||||||
uint32_t *lace_size;
|
uint32_t *lace_size;
|
||||||
|
|
||||||
@@ -2017,6 +2017,7 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
|
|||||||
|
|
||||||
*buf = data;
|
*buf = data;
|
||||||
*lace_buf = lace_size;
|
*lace_buf = lace_size;
|
||||||
|
*buf_size = size;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -2252,7 +2253,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
|||||||
matroska->skip_to_keyframe = 0;
|
matroska->skip_to_keyframe = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = matroska_parse_laces(matroska, &data, size, (flags & 0x06) >> 1,
|
res = matroska_parse_laces(matroska, &data, &size, (flags & 0x06) >> 1,
|
||||||
&lace_size, &laces);
|
&lace_size, &laces);
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
|
Reference in New Issue
Block a user