matroskadec: increase padding on several more extradata allocations.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 26 Jan 2012 16:22:34 +0000 (17:22 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 26 Jan 2012 16:23:41 +0000 (17:23 +0100)
Inspired by: 5af569aa30b93f56344ea540936eb671760f568c by alex
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/matroskadec.c

index 80ff938..b7f7740 100644 (file)
@@ -1503,7 +1503,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
                 extradata_size = 2;
         } else if (codec_id == CODEC_ID_TTA) {
             extradata_size = 30;
-            extradata = av_mallocz(extradata_size);
+            extradata = av_mallocz(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
             if (extradata == NULL)
                 return AVERROR(ENOMEM);
             ffio_init_context(&b, extradata, extradata_size, 1,
@@ -1642,7 +1642,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
             av_dict_set(&st->metadata, "mimetype", attachements[j].mime, 0);
             st->codec->codec_id = CODEC_ID_NONE;
             st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
-            st->codec->extradata  = av_malloc(attachements[j].bin.size);
+            st->codec->extradata  = av_malloc(attachements[j].bin.size + FF_INPUT_BUFFER_PADDING_SIZE);
             if(st->codec->extradata == NULL)
                 break;
             st->codec->extradata_size = attachements[j].bin.size;