smacker: pad the extradata allocation
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commit 4c22baf65363433f8c20efd1022b4ba2d8cf2288) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:

committed by
Luca Barbato

parent
5e6122ddad
commit
71b8ef938c
@@ -210,7 +210,8 @@ static int smacker_read_header(AVFormatContext *s)
|
|||||||
|
|
||||||
|
|
||||||
/* load trees to extradata, they will be unpacked by decoder */
|
/* load trees to extradata, they will be unpacked by decoder */
|
||||||
st->codec->extradata = av_malloc(smk->treesize + 16);
|
st->codec->extradata = av_mallocz(smk->treesize + 16 +
|
||||||
|
FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
st->codec->extradata_size = smk->treesize + 16;
|
st->codec->extradata_size = smk->treesize + 16;
|
||||||
if(!st->codec->extradata){
|
if(!st->codec->extradata){
|
||||||
av_log(s, AV_LOG_ERROR, "Cannot allocate %i bytes of extradata\n", smk->treesize + 16);
|
av_log(s, AV_LOG_ERROR, "Cannot allocate %i bytes of extradata\n", smk->treesize + 16);
|
||||||
|
Reference in New Issue
Block a user