ebml_read_binary: use fast_padded_malloc()
Fixes out of array accesses Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
98b377004d
commit
c63e76ba35
@ -762,8 +762,8 @@ static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
|
|||||||
*/
|
*/
|
||||||
static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)
|
static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)
|
||||||
{
|
{
|
||||||
av_free(bin->data);
|
av_fast_padded_malloc(&bin->data, &bin->size, length);
|
||||||
if (!(bin->data = av_malloc(length)))
|
if (!bin->data)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
bin->size = length;
|
bin->size = length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user