diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-06-29 23:48:34 +0200 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-07-27 15:24:59 +0100 |
commit | 059a934806d61f7af9ab3fd9f74994b838ea5eba (patch) | |
tree | 119be3b4b7b599563205c350f92e5201424510c8 /libavformat | |
parent | def97856de6021965db86c25a732d78689bd6bb0 (diff) | |
download | ffmpeg-059a934806d61f7af9ab3fd9f74994b838ea5eba.tar.gz |
lavc: Consistently prefix input buffer defines
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavformat')
61 files changed, 108 insertions, 108 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c index 6253ffb58e..2952a2172a 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -111,7 +111,7 @@ static int parse_vtrk(AVFormatContext *s, st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = AV_CODEC_ID_4XM; - st->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(4 + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = 4; diff --git a/libavformat/adxdec.c b/libavformat/adxdec.c index 9d3ebe398b..bce0493b79 100644 --- a/libavformat/adxdec.c +++ b/libavformat/adxdec.c @@ -76,7 +76,7 @@ static int adx_read_header(AVFormatContext *s) c->header_size = avio_rb16(s->pb) + 4; avio_seek(s->pb, -4, SEEK_CUR); - avctx->extradata = av_mallocz(c->header_size + FF_INPUT_BUFFER_PADDING_SIZE); + avctx->extradata = av_mallocz(c->header_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!avctx->extradata) return AVERROR(ENOMEM); if (avio_read(s->pb, avctx->extradata, c->header_size) < c->header_size) { diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index add843b267..04cca5d451 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -259,7 +259,7 @@ static int aiff_read_header(AVFormatContext *s) case MKTAG('w', 'a', 'v', 'e'): if ((uint64_t)size > (1<<30)) return -1; - st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = size; diff --git a/libavformat/anm.c b/libavformat/anm.c index 6b8e3066f3..69a13744f1 100644 --- a/libavformat/anm.c +++ b/libavformat/anm.c @@ -133,7 +133,7 @@ static int read_header(AVFormatContext *s) /* color cycling and palette data */ st->codec->extradata_size = 16*8 + 4*256; - st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) { return AVERROR(ENOMEM); } diff --git a/libavformat/apc.c b/libavformat/apc.c index 0b6c5836c1..58fd9f8771 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -53,7 +53,7 @@ static int apc_read_header(AVFormatContext *s) st->codec->extradata_size = 2 * 4; st->codec->extradata = av_malloc(st->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); diff --git a/libavformat/apetag.c b/libavformat/apetag.c index 4d65301697..5591555377 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -57,7 +57,7 @@ static int ape_tag_read_field(AVFormatContext *s) av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key); return -1; } - if (size > INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) { + if (size > INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE) { av_log(s, AV_LOG_ERROR, "APE tag size too large.\n"); return AVERROR_INVALIDDATA; } @@ -94,7 +94,7 @@ static int ape_tag_read_field(AVFormatContext *s) st->attached_pic.stream_index = st->index; st->attached_pic.flags |= AV_PKT_FLAG_KEY; } else { - st->codec->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); if (avio_read(pb, st->codec->extradata, size) != size) { diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 642ccb2ca3..9c746af075 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -674,12 +674,12 @@ static int parse_video_info(AVIOContext *pb, AVStream *st) int ret; st->codec->extradata_size = size - BMP_HEADER_SIZE; if (!(st->codec->extradata = av_malloc(st->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE))) { + AV_INPUT_BUFFER_PADDING_SIZE))) { st->codec->extradata_size = 0; return AVERROR(ENOMEM); } memset(st->codec->extradata + st->codec->extradata_size , 0, - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if ((ret = avio_read(pb, st->codec->extradata, st->codec->extradata_size)) < 0) return ret; diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 86397653bc..564318ee0c 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -625,7 +625,7 @@ static int avi_read_header(AVFormatContext *s) if (size > 10 * 4 && size < (1 << 30)) { st->codec->extradata_size = size - 10 * 4; st->codec->extradata = av_malloc(st->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) { st->codec->extradata_size = 0; return AVERROR(ENOMEM); @@ -696,7 +696,7 @@ static int avi_read_header(AVFormatContext *s) st->codec->extradata_size += 9; if ((ret = av_reallocp(&st->codec->extradata, st->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE)) < 0) { + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) { st->codec->extradata_size = 0; return ret; } else diff --git a/libavformat/avio.h b/libavformat/avio.h index a1497d9d65..889fdcf1e7 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -396,7 +396,7 @@ int avio_open_dyn_buf(AVIOContext **s); /** * Return the written size and a pointer to the buffer. The buffer * must be freed with av_free(). - * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. + * Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. * * @param s IO context * @param pbuffer pointer to a byte buffer diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 6716772464..bb575ed8a3 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -983,7 +983,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) { DynBuffer *d; int size; - static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0}; + static const char padbuf[AV_INPUT_BUFFER_PADDING_SIZE] = {0}; int padding = 0; if (!s) { @@ -994,7 +994,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) /* don't attempt to pad fixed-size packet buffers */ if (!s->max_packet_size) { avio_write(s, padbuf, sizeof(padbuf)); - padding = FF_INPUT_BUFFER_PADDING_SIZE; + padding = AV_INPUT_BUFFER_PADDING_SIZE; } avio_flush(s); diff --git a/libavformat/bink.c b/libavformat/bink.c index 3224790485..608de245d3 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -120,7 +120,7 @@ static int read_header(AVFormatContext *s) vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = AV_CODEC_ID_BINKVIDEO; - vst->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE); + vst->codec->extradata = av_mallocz(4 + AV_INPUT_BUFFER_PADDING_SIZE); if (!vst->codec->extradata) return AVERROR(ENOMEM); vst->codec->extradata_size = 4; @@ -156,7 +156,7 @@ static int read_header(AVFormatContext *s) ast->codec->channels = 1; ast->codec->channel_layout = AV_CH_LAYOUT_MONO; } - ast->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE); + ast->codec->extradata = av_mallocz(4 + AV_INPUT_BUFFER_PADDING_SIZE); if (!ast->codec->extradata) return AVERROR(ENOMEM); ast->codec->extradata_size = 4; diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index a37ceaaebd..36c39678d1 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -101,7 +101,7 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size) AVIOContext *pb = s->pb; AVStream *st = s->streams[0]; - if (size < 0 || size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE) + if (size < 0 || size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) return -1; if (st->codec->codec_id == AV_CODEC_ID_AAC) { @@ -131,7 +131,7 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size) } avio_read(pb, preamble, ALAC_PREAMBLE); - st->codec->extradata = av_mallocz(ALAC_HEADER + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(ALAC_HEADER + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); @@ -157,7 +157,7 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size) } st->codec->extradata_size = ALAC_HEADER; } else { - st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); avio_read(pb, st->codec->extradata, size); diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index 8abdd9d5b4..494bb095cc 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -58,7 +58,7 @@ static int flac_read_header(AVFormatContext *s) case FLAC_METADATA_TYPE_CUESHEET: case FLAC_METADATA_TYPE_PICTURE: case FLAC_METADATA_TYPE_VORBIS_COMMENT: - buffer = av_mallocz(metadata_size + FF_INPUT_BUFFER_PADDING_SIZE); + buffer = av_mallocz(metadata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!buffer) { return AVERROR(ENOMEM); } diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 3b0370c950..2375eb1a1f 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -592,7 +592,7 @@ static int flv_read_close(AVFormatContext *s) static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size) { av_free(st->codec->extradata); - st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = size; @@ -605,7 +605,7 @@ static int flv_queue_extradata(FLVContext *flv, AVIOContext *pb, int stream, { av_free(flv->new_extradata[stream]); flv->new_extradata[stream] = av_mallocz(size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!flv->new_extradata[stream]) return AVERROR(ENOMEM); flv->new_extradata_size[stream] = size; diff --git a/libavformat/hevc.c b/libavformat/hevc.c index 26db3b101f..e59d6a8886 100644 --- a/libavformat/hevc.c +++ b/libavformat/hevc.c @@ -636,7 +636,7 @@ static uint8_t *nal_unit_extract_rbsp(const uint8_t *src, uint32_t src_len, uint8_t *dst; uint32_t i, len; - dst = av_malloc(src_len + FF_INPUT_BUFFER_PADDING_SIZE); + dst = av_malloc(src_len + AV_INPUT_BUFFER_PADDING_SIZE); if (!dst) return NULL; diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 799eafee7c..d63d5a1171 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -495,10 +495,10 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen, goto fail; } - apic->buf = av_buffer_alloc(taglen + FF_INPUT_BUFFER_PADDING_SIZE); + apic->buf = av_buffer_alloc(taglen + AV_INPUT_BUFFER_PADDING_SIZE); if (!apic->buf || avio_read(pb, apic->buf->data, taglen) != taglen) goto fail; - memset(apic->buf->data + taglen, 0, FF_INPUT_BUFFER_PADDING_SIZE); + memset(apic->buf->data + taglen, 0, AV_INPUT_BUFFER_PADDING_SIZE); new_extra->tag = "APIC"; new_extra->data = apic; @@ -772,7 +772,7 @@ int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta) av_init_packet(&st->attached_pic); st->attached_pic.buf = apic->buf; st->attached_pic.data = apic->buf->data; - st->attached_pic.size = apic->buf->size - FF_INPUT_BUFFER_PADDING_SIZE; + st->attached_pic.size = apic->buf->size - AV_INPUT_BUFFER_PADDING_SIZE; st->attached_pic.stream_index = st->index; st->attached_pic.flags |= AV_PKT_FLAG_KEY; diff --git a/libavformat/isom.c b/libavformat/isom.c index b4001772db..0582cfdac4 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -454,7 +454,7 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext if (!len || (uint64_t)len > (1<<30)) return -1; av_free(st->codec->extradata); - st->codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(len + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); avio_read(pb, st->codec->extradata, len); diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c index 8aebbf4de8..1b1c5428bf 100644 --- a/libavformat/jvdec.c +++ b/libavformat/jvdec.c @@ -196,7 +196,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) return ret; if (ret < size) { memset(pkt->data + JV_PREAMBLE_SIZE + ret, 0, - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); pkt->flags |= AV_PKT_FLAG_CORRUPT; } pkt->size = ret + JV_PREAMBLE_SIZE; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 0425d24dc4..3556b14537 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -747,7 +747,7 @@ static int ebml_read_ascii(AVIOContext *pb, int size, char **str) static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin) { av_free(bin->data); - if (!(bin->data = av_mallocz(length + FF_INPUT_BUFFER_PADDING_SIZE))) + if (!(bin->data = av_mallocz(length + AV_INPUT_BUFFER_PADDING_SIZE))) return AVERROR(ENOMEM); bin->size = length; @@ -1205,7 +1205,7 @@ static void matroska_fix_ass_packet(MatroskaDemuxContext *matroska, es = ec / 100; ec -= 100 * es; *ptr++ = '\0'; - len = 50 + end - ptr + FF_INPUT_BUFFER_PADDING_SIZE; + len = 50 + end - ptr + AV_INPUT_BUFFER_PADDING_SIZE; if (!(line = av_buffer_alloc(len))) return; snprintf(line->data, len, @@ -1644,7 +1644,7 @@ static int matroska_parse_tracks(AVFormatContext *s) } else if (codec_id == AV_CODEC_ID_AAC && !track->codec_priv.size) { int profile = matroska_aac_profile(track->codec_id); int sri = matroska_aac_sri(track->audio.samplerate); - extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE); + extradata = av_mallocz(5 + AV_INPUT_BUFFER_PADDING_SIZE); if (!extradata) return AVERROR(ENOMEM); extradata[0] = (profile << 3) | ((sri & 0x0E) >> 1); @@ -1663,7 +1663,7 @@ static int matroska_parse_tracks(AVFormatContext *s) * decoder expects manually. */ extradata_size = 12 + track->codec_priv.size; extradata = av_mallocz(extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!extradata) return AVERROR(ENOMEM); AV_WB32(extradata, extradata_size); @@ -1768,7 +1768,7 @@ static int matroska_parse_tracks(AVFormatContext *s) st->codec->extradata_size = extradata_size; } else if (track->codec_priv.data && track->codec_priv.size > 0) { st->codec->extradata = av_mallocz(track->codec_priv.size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = track->codec_priv.size; diff --git a/libavformat/mov.c b/libavformat/mov.c index b78a1c39e8..8bf1b90c97 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -963,7 +963,7 @@ static int mov_read_smi(MOVContext *c, AVIOContext *pb, MOVAtom atom) // currently SVQ3 decoder expect full STSD header - so let's fake it // this should be fixed and just SMI header should be passed av_free(st->codec->extradata); - st->codec->extradata = av_mallocz(atom.size + 0x5a + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(atom.size + 0x5a + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = 0x5a + atom.size; @@ -1127,7 +1127,7 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (c->fc->nb_streams < 1) // will happen with jp2 files return 0; st= c->fc->streams[c->fc->nb_streams-1]; - size= (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE; + size= (uint64_t)st->codec->extradata_size + atom.size + 8 + AV_INPUT_BUFFER_PADDING_SIZE; if (size > INT_MAX || (uint64_t)atom.size > INT_MAX) return AVERROR_INVALIDDATA; if ((err = av_reallocp(&st->codec->extradata, size)) < 0) { @@ -1135,7 +1135,7 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom) return err; } buf = st->codec->extradata + st->codec->extradata_size; - st->codec->extradata_size= size - FF_INPUT_BUFFER_PADDING_SIZE; + st->codec->extradata_size= size - AV_INPUT_BUFFER_PADDING_SIZE; AV_WB32( buf , atom.size + 8); AV_WL32( buf + 4, atom.type); @@ -1161,7 +1161,7 @@ static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (st->codec->codec_id == AV_CODEC_ID_QDM2 || st->codec->codec_id == AV_CODEC_ID_QDMC) { // pass all frma atom to codec, needed at least for QDMC and QDM2 av_free(st->codec->extradata); - st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(atom.size + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = atom.size; @@ -1203,7 +1203,7 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom) return mov_read_default(c, pb, atom); } av_free(st->codec->extradata); - st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(atom.size + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = atom.size; @@ -1233,7 +1233,7 @@ static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; av_free(st->codec->extradata); - st->codec->extradata = av_mallocz(atom.size - 7 + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(atom.size - 7 + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = atom.size - 7; @@ -1266,7 +1266,7 @@ static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom) return AVERROR_INVALIDDATA; av_free(st->codec->extradata); - st->codec->extradata = av_mallocz(atom.size - 40 + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(atom.size - 40 + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = atom.size - 40; @@ -1629,7 +1629,7 @@ static int mov_rewrite_dvd_sub_extradata(AVStream *st) av_freep(&st->codec->extradata); st->codec->extradata_size = 0; - st->codec->extradata = av_mallocz(strlen(buf) + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(strlen(buf) + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); st->codec->extradata_size = strlen(buf); @@ -1646,7 +1646,7 @@ static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb, if (st->codec->codec_tag == MKTAG('t','m','c','d')) { st->codec->extradata_size = size; - st->codec->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); ret = ffio_read_size(pb, st->codec->extradata, size); @@ -2003,7 +2003,7 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom) num_bytes = (entries*field_size+4)>>3; - buf = av_malloc(num_bytes+FF_INPUT_BUFFER_PADDING_SIZE); + buf = av_malloc(num_bytes+AV_INPUT_BUFFER_PADDING_SIZE); if (!buf) { av_freep(&sc->sample_sizes); return AVERROR(ENOMEM); diff --git a/libavformat/movenc.c b/libavformat/movenc.c index d8255c8fa1..158dfa8b67 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -455,7 +455,7 @@ static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf) "dvc1 atom. Set the delay_moov flag to fix this.\n"); } - unescaped = av_mallocz(track->vos_len + FF_INPUT_BUFFER_PADDING_SIZE); + unescaped = av_mallocz(track->vos_len + AV_INPUT_BUFFER_PADDING_SIZE); if (!unescaped) return AVERROR(ENOMEM); start = find_next_marker(track->vos_data, end); diff --git a/libavformat/mpc.c b/libavformat/mpc.c index 1c8a295863..ed8d73f7b0 100644 --- a/libavformat/mpc.c +++ b/libavformat/mpc.c @@ -96,7 +96,7 @@ static int mpc_read_header(AVFormatContext *s) st->codec->bits_per_coded_sample = 16; st->codec->extradata_size = 16; - st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(st->codec->extradata_size+AV_INPUT_BUFFER_PADDING_SIZE); avio_read(s->pb, st->codec->extradata, 16); st->codec->sample_rate = mpc_rate[st->codec->extradata[2] & 3]; avpriv_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate); diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index 07f12d291c..3bc868e502 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -154,7 +154,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off) av_log(s, AV_LOG_ERROR, "Bad seek table size\n"); return; } - if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE))) + if(!(buf = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE))) return; avio_read(s->pb, buf, size); init_get_bits(&gb, buf, size * 8); @@ -242,7 +242,7 @@ static int mpc8_read_header(AVFormatContext *s) st->codec->bits_per_coded_sample = 16; st->codec->extradata_size = 2; - st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); avio_read(pb, st->codec->extradata, st->codec->extradata_size); st->codec->channels = (st->codec->extradata[1] >> 4) + 1; diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index f96d9f04a3..3a27343cf0 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -711,7 +711,7 @@ static void new_pes_packet(PESContext *pes, AVPacket *pkt) av_log(pes->stream, AV_LOG_WARNING, "PES packet size mismatch\n"); pes->flags |= AV_PKT_FLAG_CORRUPT; } - memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); + memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE); // Separate out the AC3 substream from an HDMV combined TrueHD/AC3 PID if (pes->sub_st && pes->stream_type == 0x83 && pes->extended_stream_id == 0x76) @@ -864,7 +864,7 @@ static int mpegts_push_data(MpegTSFilter *filter, /* allocate pes buffer */ pes->buffer = av_buffer_alloc(pes->total_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!pes->buffer) return AVERROR(ENOMEM); @@ -971,7 +971,7 @@ skip: new_pes_packet(pes, ts->pkt); pes->total_size = MAX_PES_PAYLOAD; pes->buffer = av_buffer_alloc(pes->total_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!pes->buffer) return AVERROR(ENOMEM); ts->stop_parse = 1; @@ -1436,7 +1436,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type memcmp(st->codec->extradata, *pp, 4)) avpriv_request_sample(fc, "DVB sub with multiple IDs"); } else { - st->codec->extradata = av_malloc(4 + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_malloc(4 + AV_INPUT_BUFFER_PADDING_SIZE); if (st->codec->extradata) { st->codec->extradata_size = 4; memcpy(st->codec->extradata, *pp, 4); @@ -1482,7 +1482,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type ext_desc_tag == 0x80) { /* User defined (provisional Opus) */ if (!st->codec->extradata) { st->codec->extradata = av_mallocz(sizeof(opus_default_extradata) + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); @@ -1956,7 +1956,7 @@ static void finished_reading_packet(AVFormatContext *s, int raw_packet_size) static int handle_packets(MpegTSContext *ts, int nb_packets) { AVFormatContext *s = ts->stream; - uint8_t packet[TS_PACKET_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; + uint8_t packet[TS_PACKET_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; const uint8_t *data; int packet_num, ret = 0; @@ -1979,7 +1979,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets) ts->stop_parse = 0; packet_num = 0; - memset(packet + TS_PACKET_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE); + memset(packet + TS_PACKET_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE); for (;;) { if (ts->stop_parse > 0) break; diff --git a/libavformat/mvi.c b/libavformat/mvi.c index 03a1f406cf..4abd1c670f 100644 --- a/libavformat/mvi.c +++ b/libavformat/mvi.c @@ -55,7 +55,7 @@ static int read_header(AVFormatContext *s) return AVERROR(ENOMEM); vst->codec->extradata_size = 2; - vst->codec->extradata = av_mallocz(2 + FF_INPUT_BUFFER_PADDING_SIZE); + vst->codec->extradata = av_mallocz(2 + AV_INPUT_BUFFER_PADDING_SIZE); version = avio_r8(pb); vst->codec->extradata[0] = avio_r8(pb); diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 25545dc603..8678dc161b 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -895,7 +895,7 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int if (IS_KLV_KEY(uid, mxf_sony_mpeg4_extradata)) { av_free(descriptor->extradata); descriptor->extradata_size = 0; - descriptor->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); + descriptor->extradata = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!descriptor->extradata) return AVERROR(ENOMEM); descriptor->extradata_size = size; @@ -1653,7 +1653,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) } } if (descriptor->extradata) { - st->codec->extradata = av_mallocz(descriptor->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(descriptor->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (st->codec->extradata) { memcpy(st->codec->extradata, descriptor->extradata, descriptor->extradata_size); st->codec->extradata_size = descriptor->extradata_size; diff --git a/libavformat/mxg.c b/libavformat/mxg.c index 1d1488c059..3cde2de1ff 100644 --- a/libavformat/mxg.c +++ b/libavformat/mxg.c @@ -110,7 +110,7 @@ static int mxg_update_cache(AVFormatContext *s, unsigned int cache_size) if (mxg->soi_ptr) soi_pos = mxg->soi_ptr - mxg->buffer; mxg->buffer = av_fast_realloc(mxg->buffer, &mxg->buffer_size, current_pos + cache_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!mxg->buffer) return AVERROR(ENOMEM); mxg->buffer_ptr = mxg->buffer + current_pos; diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 47f6e318b3..bf1ab7b933 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -408,7 +408,7 @@ static int decode_stream_header(NUTContext *nut) GET_V(st->codec->extradata_size, tmp < (1 << 30)); if (st->codec->extradata_size) { st->codec->extradata = av_mallocz(st->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); avio_read(bc, st->codec->extradata, st->codec->extradata_size); diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index f37c4af826..15526ffa01 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -74,7 +74,7 @@ static int ogg_save(AVFormatContext *s) for (i = 0; i < ogg->nstreams; i++) { struct ogg_stream *os = ogg->streams + i; - os->buf = av_mallocz(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE); + os->buf = av_mallocz(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE); memcpy(os->buf, ost->streams[i].buf, os->bufpos); } @@ -172,7 +172,7 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream) os = ogg->streams + idx; os->serial = serial; os->bufsize = DECODER_BUFFER_SIZE; - os->buf = av_malloc(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE); + os->buf = av_malloc(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE); os->header = -1; os->start_granule = OGG_NOGRANULE_VALUE; @@ -191,7 +191,7 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream) static int ogg_new_buf(struct ogg *ogg, int idx) { struct ogg_stream *os = ogg->streams + idx; - uint8_t *nb = av_malloc(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE); + uint8_t *nb = av_malloc(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE); int size = os->bufpos - os->pstart; if (!nb) @@ -315,7 +315,7 @@ static int ogg_read_page(AVFormatContext *s, int *str) } if (os->bufsize - os->bufpos < size) { - uint8_t *nb = av_malloc((os->bufsize *= 2) + FF_INPUT_BUFFER_PADDING_SIZE); + uint8_t *nb = av_malloc((os->bufsize *= 2) + AV_INPUT_BUFFER_PADDING_SIZE); if (!nb) return AVERROR(ENOMEM); memcpy(nb, os->buf, os->bufpos); @@ -331,7 +331,7 @@ static int ogg_read_page(AVFormatContext *s, int *str) os->granule = gp; os->flags = flags; - memset(os->buf + os->bufpos, 0, FF_INPUT_BUFFER_PADDING_SIZE); + memset(os->buf + os->bufpos, 0, AV_INPUT_BUFFER_PADDING_SIZE); if (str) *str = idx; diff --git a/libavformat/oggparsecelt.c b/libavformat/oggparsecelt.c index 7084e768a3..ab8532090e 100644 --- a/libavformat/oggparsecelt.c +++ b/libavformat/oggparsecelt.c @@ -47,7 +47,7 @@ static int celt_header(AVFormatContext *s, int idx) uint8_t *extradata; extradata = av_malloc(2 * sizeof(uint32_t) + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); priv = av_malloc(sizeof(struct oggcelt_private)); if (!extradata || !priv) { av_free(extradata); diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c index 57bba68079..30a4840120 100644 --- a/libavformat/oggparseflac.c +++ b/libavformat/oggparseflac.c @@ -62,7 +62,7 @@ flac_header (AVFormatContext * s, int idx) st->need_parsing = AVSTREAM_PARSE_HEADERS; st->codec->extradata = - av_malloc(FLAC_STREAMINFO_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); + av_malloc(FLAC_STREAMINFO_SIZE + AV_INPUT_BUFFER_PADDING_SIZE); memcpy(st->codec->extradata, streaminfo_start, FLAC_STREAMINFO_SIZE); st->codec->extradata_size = FLAC_STREAMINFO_SIZE; diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c index 5931ab543b..1851ff11ee 100644 --- a/libavformat/oggparseopus.c +++ b/libavformat/oggparseopus.c @@ -57,7 +57,7 @@ static int opus_header(AVFormatContext *avf, int idx) st->codec->channels = AV_RL8(packet + 9); priv->pre_skip = AV_RL16(packet + 10); - extradata = av_malloc(os->psize + FF_INPUT_BUFFER_PADDING_SIZE); + extradata = av_malloc(os->psize + AV_INPUT_BUFFER_PADDING_SIZE); if (!extradata) return AVERROR(ENOMEM); diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c index b2779e74c1..f7af79418f 100644 --- a/libavformat/oggparsespeex.c +++ b/libavformat/oggparsespeex.c @@ -74,7 +74,7 @@ static int speex_header(AVFormatContext *s, int idx) { st->codec->extradata_size = os->psize; st->codec->extradata = av_malloc(st->codec->extradata_size - + FF_INPUT_BUFFER_PADDING_SIZE); + + AV_INPUT_BUFFER_PADDING_SIZE); memcpy(st->codec->extradata, p, st->codec->extradata_size); avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate); diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index d78f02d67a..01d1518c2a 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -126,7 +126,7 @@ static int theora_header(AVFormatContext *s, int idx) } if ((err = av_reallocp(&st->codec->extradata, - cds + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) { + cds + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) { st->codec->extradata_size = 0; return err; } diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index b2f9c8b03e..aac0f0e980 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -234,7 +234,7 @@ static int fixup_vorbis_headers(AVFormatContext *as, offset += priv->len[i]; av_freep(&priv->packet[i]); } - if ((err = av_reallocp(buf, offset + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) + if ((err = av_reallocp(buf, offset + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) return err; return offset; } diff --git a/libavformat/omadec.c b/libavformat/omadec.c index 8dc35d17c2..28276d941d 100644 --- a/libavformat/omadec.c +++ b/libavformat/omadec.c @@ -357,7 +357,7 @@ static int oma_read_header(AVFormatContext *s) /* fake the ATRAC3 extradata * (wav format, makes stream copy to wav work) */ st->codec->extradata_size = 14; - edata = av_mallocz(14 + FF_INPUT_BUFFER_PADDING_SIZE); + edata = av_mallocz(14 + AV_INPUT_BUFFER_PADDING_SIZE); if (!edata) return AVERROR(ENOMEM); diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index 65cb6bb00f..74ca272300 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -49,7 +49,7 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt) } else if (ret < size) { /* initialize end of packet for partial reads to avoid reading * uninitialized data on allowed overreads */ - memset(pkt->data + ret, 0, FF_INPUT_BUFFER_PADDING_SIZE); + memset(pkt->data + ret, 0, AV_INPUT_BUFFER_PADDING_SIZE); } pkt->size = ret; return ret; diff --git a/libavformat/rdt.c b/libavformat/rdt.c index 5478f88fc6..091bff2981 100644 --- a/libavformat/rdt.c +++ b/libavformat/rdt.c @@ -86,7 +86,7 @@ struct PayloadContext { RMStream **rmst; uint8_t *mlti_data; unsigned int mlti_data_size; - char buffer[RTP_MAX_PACKET_LENGTH + FF_INPUT_BUFFER_PADDING_SIZE]; + char buffer[RTP_MAX_PACKET_LENGTH + AV_INPUT_BUFFER_PADDING_SIZE]; int audio_pkt_cnt; /**< remaining audio packets in rmdec */ }; @@ -398,7 +398,7 @@ rdt_parse_b64buf (unsigned int *target_len, const char *p) len -= 2; /* skip embracing " at start/end */ } *target_len = len * 3 / 4; - target = av_mallocz(*target_len + FF_INPUT_BUFFER_PADDING_SIZE); + target = av_mallocz(*target_len + AV_INPUT_BUFFER_PADDING_SIZE); if (!target) return NULL; av_base64_decode(target, p, *target_len); diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index 4d7b684e68..41b7a9c865 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -114,7 +114,7 @@ int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, if (cbSize > 0) { av_free(codec->extradata); codec->extradata = av_mallocz(codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!codec->extradata) return AVERROR(ENOMEM); avio_read(pb, codec->extradata, codec->extradata_size); diff --git a/libavformat/rl2.c b/libavformat/rl2.c index 5d30bf8bd6..a6544c3a60 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -132,7 +132,7 @@ static av_cold int rl2_read_header(AVFormatContext *s) st->codec->extradata_size += back_size; st->codec->extradata = av_mallocz(st->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if(!st->codec->extradata) return AVERROR(ENOMEM); diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index cab75fd338..d28a2a8d1e 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -86,7 +86,7 @@ static int rm_read_extradata(AVIOContext *pb, AVCodecContext *avctx, unsigned si { if (size >= 1<<24) return -1; - avctx->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); + avctx->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!avctx->extradata) return AVERROR(ENOMEM); avctx->extradata_size = avio_read(pb, avctx->extradata, size); @@ -203,7 +203,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, if (version == 5) avio_r8(pb); codecdata_length = avio_rb32(pb); - if(codecdata_length + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){ + if(codecdata_length + AV_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){ av_log(s, AV_LOG_ERROR, "codecdata_length too large\n"); return -1; } @@ -231,7 +231,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, if (version == 5) avio_r8(pb); codecdata_length = avio_rb32(pb); - if(codecdata_length + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){ + if(codecdata_length + AV_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){ av_log(s, AV_LOG_ERROR, "codecdata_length too large\n"); return -1; } diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index 1a690115e5..e8543ee06d 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -119,7 +119,7 @@ int ff_h264_parse_sprop_parameter_sets(AVFormatContext *s, uint8_t *dest = av_realloc(*data_ptr, packet_size + sizeof(start_sequence) + *size_ptr + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!dest) { av_log(s, AV_LOG_ERROR, "Unable to allocate memory for extradata!\n"); @@ -132,7 +132,7 @@ int ff_h264_parse_sprop_parameter_sets(AVFormatContext *s, memcpy(dest + *size_ptr + sizeof(start_sequence), decoded_packet, packet_size); memset(dest + *size_ptr + sizeof(start_sequence) + - packet_size, 0, FF_INPUT_BUFFER_PADDING_SIZE); + packet_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); *size_ptr += sizeof(start_sequence) + packet_size; } diff --git a/libavformat/rtpdec_hevc.c b/libavformat/rtpdec_hevc.c index a4d9c54e0b..dee904397c 100644 --- a/libavformat/rtpdec_hevc.c +++ b/libavformat/rtpdec_hevc.c @@ -148,7 +148,7 @@ static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index, codec->extradata_size = hevc_data->vps_size + hevc_data->sps_size + hevc_data->pps_size + hevc_data->sei_size; codec->extradata = av_malloc(codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!codec->extradata) { ret = AVERROR(ENOMEM); codec->extradata_size = 0; @@ -162,7 +162,7 @@ static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index, pos += hevc_data->pps_size; memcpy(codec->extradata + pos, hevc_data->sei, hevc_data->sei_size); pos += hevc_data->sei_size; - memset(codec->extradata + pos, 0, FF_INPUT_BUFFER_PADDING_SIZE); + memset(codec->extradata + pos, 0, AV_INPUT_BUFFER_PADDING_SIZE); } av_freep(&hevc_data->vps); diff --git a/libavformat/rtpdec_latm.c b/libavformat/rtpdec_latm.c index 5c54c202d0..d22cc1d215 100644 --- a/libavformat/rtpdec_latm.c +++ b/libavformat/rtpdec_latm.c @@ -97,7 +97,7 @@ static int parse_fmtp_config(AVStream *st, const char *value) int audio_mux_version, same_time_framing, num_programs, num_layers; /* Pad this buffer, too, to avoid out of bounds reads with get_bits below */ - config = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE); + config = av_mallocz(len + AV_INPUT_BUFFER_PADDING_SIZE); if (!config) return AVERROR(ENOMEM); ff_hex_to_data(config, value); @@ -118,7 +118,7 @@ static int parse_fmtp_config(AVStream *st, const char *value) av_freep(&st->codec->extradata); st->codec->extradata_size = (get_bits_left(&gb) + 7)/8; st->codec->extradata = av_mallocz(st->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) { ret = AVERROR(ENOMEM); goto end; diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c index c08242e792..a8c9943537 100644 --- a/libavformat/rtpdec_mpeg4.c +++ b/libavformat/rtpdec_mpeg4.c @@ -102,7 +102,7 @@ static int parse_fmtp_config(AVCodecContext *codec, const char *value) /* decode the hexa encoded parameter */ int len = ff_hex_to_data(NULL, value); av_free(codec->extradata); - codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE); + codec->extradata = av_mallocz(len + AV_INPUT_BUFFER_PADDING_SIZE); if (!codec->extradata) return AVERROR(ENOMEM); codec->extradata_size = len; diff --git a/libavformat/rtpdec_qdm2.c b/libavformat/rtpdec_qdm2.c index 8eea571460..16dd48920e 100644 --- a/libavformat/rtpdec_qdm2.c +++ b/libavformat/rtpdec_qdm2.c @@ -104,7 +104,7 @@ static int qdm2_parse_config(PayloadContext *qdm, AVStream *st, return AVERROR_INVALIDDATA; av_freep(&st->codec->extradata); st->codec->extradata_size = 26 + item_len; - if (!(st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE))) { + if (!(st->codec->extradata = av_mallocz(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE))) { st->codec->extradata_size = 0; return AVERROR(ENOMEM); } diff --git a/libavformat/rtpdec_qt.c b/libavformat/rtpdec_qt.c index 62aee89e50..002413dec2 100644 --- a/libavformat/rtpdec_qt.c +++ b/libavformat/rtpdec_qt.c @@ -174,14 +174,14 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, if (qt->pkt.size > 0 && qt->timestamp == *timestamp) { int err; if ((err = av_reallocp(&qt->pkt.data, qt->pkt.size + alen + - FF_INPUT_BUFFER_PADDING_SIZE)) < 0) { + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) { qt->pkt.size = 0; return err; } } else { av_freep(&qt->pkt.data); av_init_packet(&qt->pkt); - qt->pkt.data = av_realloc(NULL, alen + FF_INPUT_BUFFER_PADDING_SIZE); + qt->pkt.data = av_realloc(NULL, alen + AV_INPUT_BUFFER_PADDING_SIZE); if (!qt->pkt.data) return AVERROR(ENOMEM); qt->pkt.size = 0; @@ -198,7 +198,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, qt->pkt.data = NULL; pkt->flags = keyframe ? AV_PKT_FLAG_KEY : 0; pkt->stream_index = st->index; - memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); + memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE); return 0; } return AVERROR(EAGAIN); diff --git a/libavformat/rtpdec_svq3.c b/libavformat/rtpdec_svq3.c index 3104795165..004696fa54 100644 --- a/libavformat/rtpdec_svq3.c +++ b/libavformat/rtpdec_svq3.c @@ -62,7 +62,7 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv, st->codec->extradata_size = 0; if (len < 2 || !(st->codec->extradata = - av_malloc(len + 8 + FF_INPUT_BUFFER_PADDING_SIZE))) + av_malloc(len + 8 + AV_INPUT_BUFFER_PADDING_SIZE))) return AVERROR_INVALIDDATA; st->codec->extradata_size = len + 8; diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c index 66e619149b..5e17181ff3 100644 --- a/libavformat/rtpdec_xiph.c +++ b/libavformat/rtpdec_xiph.c @@ -262,8 +262,8 @@ parse_packed_headers(const uint8_t * packed_headers, /* allocate extra space: * -- length/255 +2 for xiphlacing * -- one for the '2' marker - * -- FF_INPUT_BUFFER_PADDING_SIZE required */ - extradata_alloc = length + length/255 + 3 + FF_INPUT_BUFFER_PADDING_SIZE; + * -- AV_INPUT_BUFFER_PADDING_SIZE required */ + extradata_alloc = length + length/255 + 3 + AV_INPUT_BUFFER_PADDING_SIZE; ptr = codec->extradata = av_malloc(extradata_alloc); if (!ptr) { diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 279633fe99..c6f9c035c5 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -120,7 +120,7 @@ static int vmd_read_header(AVFormatContext *s) vst->codec->height >>= 1; } vst->codec->extradata_size = VMD_HEADER_SIZE; - vst->codec->extradata = av_mallocz(VMD_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); + vst->codec->extradata = av_mallocz(VMD_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE); memcpy(vst->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE); /* if sample rate is 0, assume no audio */ diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 2fa531bf64..b1d8e95f5c 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -213,7 +213,7 @@ static int smacker_read_header(AVFormatContext *s) /* load trees to extradata, they will be unpacked by decoder */ st->codec->extradata = av_mallocz(smk->treesize + 16 + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); st->codec->extradata_size = smk->treesize + 16; if(!st->codec->extradata){ av_log(s, AV_LOG_ERROR, diff --git a/libavformat/smush.c b/libavformat/smush.c index 1615b45417..94ecb5cb17 100644 --- a/libavformat/smush.c +++ b/libavformat/smush.c @@ -161,7 +161,7 @@ static int smush_read_header(AVFormatContext *ctx) av_free(vst->codec->extradata); vst->codec->extradata_size = 1024 + 2; vst->codec->extradata = av_malloc(vst->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!vst->codec->extradata) return AVERROR(ENOMEM); diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c index 432654affd..7162f0827b 100644 --- a/libavformat/spdifenc.c +++ b/libavformat/spdifenc.c @@ -525,7 +525,7 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt) if (ctx->extra_bswap ^ (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN)) { avio_write(s->pb, ctx->out_buf, ctx->out_bytes & ~1); } else { - av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + FF_INPUT_BUFFER_PADDING_SIZE); + av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + AV_INPUT_BUFFER_PADDING_SIZE); if (!ctx->buffer) return AVERROR(ENOMEM); ff_spdif_bswap_buf16((uint16_t *)ctx->buffer, (uint16_t *)ctx->out_buf, ctx->out_bytes >> 1); diff --git a/libavformat/takdec.c b/libavformat/takdec.c index 584cbccb50..902ba05097 100644 --- a/libavformat/takdec.c +++ b/libavformat/takdec.c @@ -71,7 +71,7 @@ static int tak_read_header(AVFormatContext *s) case TAK_METADATA_STREAMINFO: case TAK_METADATA_LAST_FRAME: case TAK_METADATA_ENCODER: - buffer = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); + buffer = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!buffer) return AVERROR(ENOMEM); diff --git a/libavformat/tta.c b/libavformat/tta.c index bc86a777b3..f5304f31ed 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -113,12 +113,12 @@ static int tta_read_header(AVFormatContext *s) st->codec->bits_per_coded_sample = bps; st->codec->extradata_size = avio_tell(s->pb) - start_offset; - if(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){ + if(st->codec->extradata_size+AV_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){ //this check is redundant as avio_read should fail av_log(s, AV_LOG_ERROR, "extradata_size too large\n"); return -1; } - st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(st->codec->extradata_size+AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) { st->codec->extradata_size = 0; return AVERROR(ENOMEM); diff --git a/libavformat/utils.c b/libavformat/utils.c index fd393082e4..d72f5331be 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2241,7 +2241,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) if (i > 0 && i < FF_MAX_EXTRADATA_SIZE) { st->codec->extradata_size = i; st->codec->extradata = av_mallocz(st->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); memcpy(st->codec->extradata, pkt->data, @@ -3083,7 +3083,7 @@ int ff_generate_avci_extradata(AVStream *st) av_freep(&st->codec->extradata); st->codec->extradata_size = 0; - st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); diff --git a/libavformat/vqf.c b/libavformat/vqf.c index c04ffe74ee..49895c03a8 100644 --- a/libavformat/vqf.c +++ b/libavformat/vqf.c @@ -215,7 +215,7 @@ static int vqf_read_header(AVFormatContext *s) avpriv_set_pts_info(st, 64, size, st->codec->sample_rate); /* put first 12 bytes of COMM chunk in extradata */ - if (!(st->codec->extradata = av_malloc(12 + FF_INPUT_BUFFER_PADDING_SIZE))) + if (!(st->codec->extradata = av_malloc(12 + AV_INPUT_BUFFER_PADDING_SIZE))) return AVERROR(ENOMEM); st->codec->extradata_size = 12; memcpy(st->codec->extradata, comm_chunk, 12); diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c index 77da375e70..1f2359e83d 100644 --- a/libavformat/westwood_vqa.c +++ b/libavformat/westwood_vqa.c @@ -102,7 +102,7 @@ static int wsvqa_read_header(AVFormatContext *s) /* the VQA header needs to go to the decoder */ st->codec->extradata_size = VQA_HEADER_SIZE; - st->codec->extradata = av_mallocz(VQA_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(VQA_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE); header = (unsigned char *)st->codec->extradata; if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) != VQA_HEADER_SIZE) { @@ -224,7 +224,7 @@ static int wsvqa_read_packet(AVFormatContext *s, case SND2_TAG: st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_WS; st->codec->extradata_size = 2; - st->codec->extradata = av_mallocz(2 + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(2 + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); AV_WL16(st->codec->extradata, wsvqa->version); diff --git a/libavformat/xmv.c b/libavformat/xmv.c index bcb17f8893..b8e3191607 100644 --- a/libavformat/xmv.c +++ b/libavformat/xmv.c @@ -393,7 +393,7 @@ static int xmv_process_packet_header(AVFormatContext *s) av_free(vst->codec->extradata); vst->codec->extradata = - av_malloc(4 + FF_INPUT_BUFFER_PADDING_SIZE); + av_malloc(4 + AV_INPUT_BUFFER_PADDING_SIZE); vst->codec->extradata_size = 4; } diff --git a/libavformat/xwma.c b/libavformat/xwma.c index cab4616070..b24cde857b 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -105,7 +105,7 @@ static int xwma_read_header(AVFormatContext *s) st->codec->extradata_size); } else { st->codec->extradata_size = 6; - st->codec->extradata = av_mallocz(6 + FF_INPUT_BUFFER_PADDING_SIZE); + st->codec->extradata = av_mallocz(6 + AV_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) return AVERROR(ENOMEM); diff --git a/libavformat/yop.c b/libavformat/yop.c index 08fcc19e3c..b809ad2b56 100644 --- a/libavformat/yop.c +++ b/libavformat/yop.c @@ -63,7 +63,7 @@ static int yop_read_header(AVFormatContext *s) // Extra data that will be passed to the decoder - video_stream->codec->extradata = av_mallocz(8 + FF_INPUT_BUFFER_PADDING_SIZE); + video_stream->codec->extradata = av_mallocz(8 + AV_INPUT_BUFFER_PADDING_SIZE); if (!video_stream->codec->extradata) return AVERROR(ENOMEM); |