mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
lavf/bintext: allocate FF_INPUT_BUFFER_PADDING_SIZE for extradata
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
eae983f4ff
commit
c61c8536ef
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user