smackerdemux: Allocate padding for extradata
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Apr 2012 09:23:58 +0000 (11:23 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Apr 2012 09:23:58 +0000 (11:23 +0200)
Fixes slight overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/smacker.c

index a3545f4..84a53ea 100644 (file)
@@ -203,7 +203,7 @@ static int smacker_read_header(AVFormatContext *s)
 
 
     /* load trees to extradata, they will be unpacked by decoder */
-    st->codec->extradata = av_malloc(smk->treesize + 16);
+    st->codec->extradata = av_malloc(smk->treesize + 16 + FF_INPUT_BUFFER_PADDING_SIZE);
     st->codec->extradata_size = smk->treesize + 16;
     if(!st->codec->extradata){
         av_log(s, AV_LOG_ERROR, "Cannot allocate %i bytes of extradata\n", smk->treesize + 16);