lavf/bintext: allocate FF_INPUT_BUFFER_PADDING_SIZE for extradata

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-06-09 14:36:41 +02:00
parent eae983f4ff
commit c61c8536ef
1 changed files with 4 additions and 4 deletions

View File

@ -151,7 +151,7 @@ static int bintext_read_header(AVFormatContext *s)
st->codec->codec_id = CODEC_ID_BINTEXT;
st->codec->extradata_size = 2;
st->codec->extradata = av_malloc(st->codec->extradata_size);
st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
st->codec->extradata[0] = 16;
@ -208,7 +208,7 @@ static int xbin_read_header(AVFormatContext *s)
st->codec->extradata_size += fontheight * (flags & 0x10 ? 512 : 256);
st->codec->codec_id = flags & 4 ? CODEC_ID_XBIN : CODEC_ID_BINTEXT;
st->codec->extradata = av_malloc(st->codec->extradata_size);
st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
st->codec->extradata[0] = fontheight;
@ -242,7 +242,7 @@ static int adf_read_header(AVFormatContext *s)
st->codec->codec_id = CODEC_ID_BINTEXT;
st->codec->extradata_size = 2 + 48 + 4096;
st->codec->extradata = av_malloc(st->codec->extradata_size);
st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
st->codec->extradata[0] = 16;
@ -299,7 +299,7 @@ static int idf_read_header(AVFormatContext *s)
st->codec->codec_id = CODEC_ID_IDF;
st->codec->extradata_size = 2 + 48 + 4096;
st->codec->extradata = av_malloc(st->codec->extradata_size);
st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
st->codec->extradata[0] = 16;