diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-10-13 10:30:59 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-10-13 20:13:38 +0000 |
commit | a807c68253b02cce8b9fbc87d7857c31d531a1ee (patch) | |
tree | e4097d5fd4a2cf8dc03c6f97ebfadc4d20ce8ac2 /libavformat/bintext.c | |
parent | 3fd79833e266aec2d77cf07092e8b1406fd307d4 (diff) | |
download | ffmpeg-a807c68253b02cce8b9fbc87d7857c31d531a1ee.tar.gz |
avformat: use ff_alloc_extradata()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/bintext.c')
-rw-r--r-- | libavformat/bintext.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libavformat/bintext.c b/libavformat/bintext.c index c1c6c0064a..d5046075a1 100644 --- a/libavformat/bintext.c +++ b/libavformat/bintext.c @@ -136,9 +136,7 @@ static int bintext_read_header(AVFormatContext *s) return AVERROR(ENOMEM); st->codec->codec_id = AV_CODEC_ID_BINTEXT; - st->codec->extradata_size = 2; - st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); - if (!st->codec->extradata) + if (ff_alloc_extradata(st->codec, 2)) return AVERROR(ENOMEM); st->codec->extradata[0] = 16; st->codec->extradata[1] = 0; @@ -194,8 +192,7 @@ static int xbin_read_header(AVFormatContext *s) st->codec->extradata_size += fontheight * (flags & 0x10 ? 512 : 256); st->codec->codec_id = flags & 4 ? AV_CODEC_ID_XBIN : AV_CODEC_ID_BINTEXT; - st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); - if (!st->codec->extradata) + if (ff_alloc_extradata(st->codec, st->codec->extradata_size)) return AVERROR(ENOMEM); st->codec->extradata[0] = fontheight; st->codec->extradata[1] = flags; @@ -227,9 +224,7 @@ static int adf_read_header(AVFormatContext *s) return AVERROR(ENOMEM); st->codec->codec_id = AV_CODEC_ID_BINTEXT; - st->codec->extradata_size = 2 + 48 + 4096; - st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); - if (!st->codec->extradata) + if (ff_alloc_extradata(st->codec, 2 + 48 + 4096)) return AVERROR(ENOMEM); st->codec->extradata[0] = 16; st->codec->extradata[1] = BINTEXT_PALETTE|BINTEXT_FONT; @@ -284,9 +279,7 @@ static int idf_read_header(AVFormatContext *s) return AVERROR(ENOMEM); st->codec->codec_id = AV_CODEC_ID_IDF; - st->codec->extradata_size = 2 + 48 + 4096; - st->codec->extradata = av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); - if (!st->codec->extradata) + if (ff_alloc_extradata(st->codec, 2 + 48 + 4096)) return AVERROR(ENOMEM); st->codec->extradata[0] = 16; st->codec->extradata[1] = BINTEXT_PALETTE|BINTEXT_FONT; |