Browse code

lavc: Consistently prefix input buffer defines

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>

Vittorio Giovara authored on 2015/06/30 06:48:34
Showing 150 changed files
... ...
@@ -1732,7 +1732,7 @@ static int transcode_init(void)
1732 1732
 
1733 1733
             av_assert0(ist && !ost->filter);
1734 1734
 
1735
-            extra_size = (uint64_t)dec_ctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE;
1735
+            extra_size = (uint64_t)dec_ctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE;
1736 1736
 
1737 1737
             if (extra_size > INT_MAX) {
1738 1738
                 return AVERROR(EINVAL);
... ...
@@ -226,7 +226,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
226 226
     AVCodecContext *c= NULL;
227 227
     int len;
228 228
     FILE *f, *outfile;
229
-    uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
229
+    uint8_t inbuf[AUDIO_INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
230 230
     AVPacket avpkt;
231 231
     AVFrame *decoded_frame = NULL;
232 232
 
... ...
@@ -459,14 +459,14 @@ static void video_decode_example(const char *outfilename, const char *filename)
459 459
     int frame, got_picture, len;
460 460
     FILE *f;
461 461
     AVFrame *picture;
462
-    uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
462
+    uint8_t inbuf[INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
463 463
     char buf[1024];
464 464
     AVPacket avpkt;
465 465
 
466 466
     av_init_packet(&avpkt);
467 467
 
468 468
     /* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */
469
-    memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
469
+    memset(inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
470 470
 
471 471
     printf("Video decoding\n");
472 472
 
... ...
@@ -405,7 +405,7 @@ int main(int argc, char **argv)
405 405
     decoder_ctx->codec_id = AV_CODEC_ID_H264;
406 406
     if (video_st->codec->extradata_size) {
407 407
         decoder_ctx->extradata = av_mallocz(video_st->codec->extradata_size +
408
-                                            FF_INPUT_BUFFER_PADDING_SIZE);
408
+                                            AV_INPUT_BUFFER_PADDING_SIZE);
409 409
         if (!decoder_ctx->extradata) {
410 410
             ret = AVERROR(ENOMEM);
411 411
             goto finish;
... ...
@@ -446,13 +446,13 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
446 446
     }
447 447
 
448 448
     av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size,
449
-                   bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
449
+                   bitstream_size + AV_INPUT_BUFFER_PADDING_SIZE);
450 450
     if (!f->bitstream_buffer)
451 451
         return AVERROR(ENOMEM);
452 452
     f->bbdsp.bswap_buf(f->bitstream_buffer, (const uint32_t *) (buf + extra),
453 453
                        bitstream_size / 4);
454 454
     memset((uint8_t*)f->bitstream_buffer + bitstream_size,
455
-           0, FF_INPUT_BUFFER_PADDING_SIZE);
455
+           0, AV_INPUT_BUFFER_PADDING_SIZE);
456 456
     init_get_bits(&f->gb, f->bitstream_buffer, 8 * bitstream_size);
457 457
 
458 458
     wordstream_offset = extra + bitstream_size;
... ...
@@ -769,13 +769,13 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
769 769
     prestream_size = length + buf - prestream;
770 770
 
771 771
     av_fast_malloc(&f->bitstream_buffer, &f->bitstream_buffer_size,
772
-                   prestream_size + FF_INPUT_BUFFER_PADDING_SIZE);
772
+                   prestream_size + AV_INPUT_BUFFER_PADDING_SIZE);
773 773
     if (!f->bitstream_buffer)
774 774
         return AVERROR(ENOMEM);
775 775
     f->bbdsp.bswap_buf(f->bitstream_buffer, (const uint32_t *) prestream,
776 776
                        prestream_size / 4);
777 777
     memset((uint8_t*)f->bitstream_buffer + prestream_size,
778
-           0, FF_INPUT_BUFFER_PADDING_SIZE);
778
+           0, AV_INPUT_BUFFER_PADDING_SIZE);
779 779
     init_get_bits(&f->pre_gb, f->bitstream_buffer, 8 * prestream_size);
780 780
 
781 781
     f->last_dc = 0 * 128 * 8 * 8;
... ...
@@ -849,7 +849,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
849 849
         cfrm = &f->cfrm[i];
850 850
 
851 851
         cfrm->data = av_fast_realloc(cfrm->data, &cfrm->allocated_size,
852
-                                     cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
852
+                                     cfrm->size + data_size + AV_INPUT_BUFFER_PADDING_SIZE);
853 853
         // explicit check needed as memcpy below might not catch a NULL
854 854
         if (!cfrm->data) {
855 855
             av_log(f->avctx, AV_LOG_ERROR, "realloc failure");
... ...
@@ -209,7 +209,7 @@ static av_cold int a64multi_encode_init(AVCodecContext *avctx)
209 209
     }
210 210
 
211 211
     /* set up extradata */
212
-    if (!(avctx->extradata = av_mallocz(8 * 4 + FF_INPUT_BUFFER_PADDING_SIZE))) {
212
+    if (!(avctx->extradata = av_mallocz(8 * 4 + AV_INPUT_BUFFER_PADDING_SIZE))) {
213 213
         av_log(avctx, AV_LOG_ERROR, "Failed to allocate memory for extradata.\n");
214 214
         return AVERROR(ENOMEM);
215 215
     }
... ...
@@ -88,7 +88,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
88 88
             buf      += get_bits_count(&gb)/8;
89 89
         }
90 90
         avctx->extradata_size = 2 + pce_size;
91
-        avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
91
+        avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
92 92
         if (!avctx->extradata)
93 93
             return AVERROR(ENOMEM);
94 94
 
... ...
@@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
34 34
     int size;
35 35
     union {
36 36
         uint64_t u64;
37
-        uint8_t  u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
37
+        uint8_t  u8[8 + AV_INPUT_BUFFER_PADDING_SIZE];
38 38
     } tmp;
39 39
 
40 40
     tmp.u64 = av_be2ne64(state);
... ...
@@ -2969,7 +2969,7 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
2969 2969
     if (new_extradata) {
2970 2970
         av_free(avctx->extradata);
2971 2971
         avctx->extradata = av_mallocz(new_extradata_size +
2972
-                                      FF_INPUT_BUFFER_PADDING_SIZE);
2972
+                                      AV_INPUT_BUFFER_PADDING_SIZE);
2973 2973
         if (!avctx->extradata)
2974 2974
             return AVERROR(ENOMEM);
2975 2975
         avctx->extradata_size = new_extradata_size;
... ...
@@ -3089,14 +3089,14 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
3089 3089
 
3090 3090
         if (avctx->extradata_size < esize) {
3091 3091
             av_free(avctx->extradata);
3092
-            avctx->extradata = av_malloc(esize + FF_INPUT_BUFFER_PADDING_SIZE);
3092
+            avctx->extradata = av_malloc(esize + AV_INPUT_BUFFER_PADDING_SIZE);
3093 3093
             if (!avctx->extradata)
3094 3094
                 return AVERROR(ENOMEM);
3095 3095
         }
3096 3096
 
3097 3097
         avctx->extradata_size = esize;
3098 3098
         memcpy(avctx->extradata, gb->buffer + (config_start_bit/8), esize);
3099
-        memset(avctx->extradata+esize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
3099
+        memset(avctx->extradata+esize, 0, AV_INPUT_BUFFER_PADDING_SIZE);
3100 3100
     }
3101 3101
     skip_bits_long(gb, bits_consumed);
3102 3102
 
... ...
@@ -711,7 +711,7 @@ static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
711 711
     int ch;
712 712
     FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail);
713 713
     FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail);
714
-    FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + FF_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
714
+    FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + AV_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
715 715
 
716 716
     for(ch = 0; ch < s->channels; ch++)
717 717
         s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch;
... ...
@@ -150,7 +150,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
150 150
     int err;
151 151
     union {
152 152
         uint64_t u64;
153
-        uint8_t  u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
153
+        uint8_t  u8[8 + AV_INPUT_BUFFER_PADDING_SIZE];
154 154
     } tmp = { av_be2ne64(state) };
155 155
     AC3HeaderInfo hdr;
156 156
     GetBitContext gbc;
... ...
@@ -217,7 +217,7 @@ typedef struct AC3DecodeContext {
217 217
     DECLARE_ALIGNED(32, float, window)[AC3_BLOCK_SIZE];                              ///< window coefficients
218 218
     DECLARE_ALIGNED(32, float, tmp_output)[AC3_BLOCK_SIZE];                          ///< temporary storage for output before windowing
219 219
     DECLARE_ALIGNED(32, float, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE];            ///< output after imdct transform and windowing
220
-    DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread
220
+    DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread
221 221
 ///@}
222 222
 } AC3DecodeContext;
223 223
 
... ...
@@ -111,7 +111,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
111 111
         avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 /
112 112
                              avctx->channels + 2;
113 113
         avctx->block_align    = BLKSIZE;
114
-        if (!(avctx->extradata = av_malloc(32 + FF_INPUT_BUFFER_PADDING_SIZE)))
114
+        if (!(avctx->extradata = av_malloc(32 + AV_INPUT_BUFFER_PADDING_SIZE)))
115 115
             goto error;
116 116
         avctx->extradata_size = 32;
117 117
         extradata = avctx->extradata;
... ...
@@ -519,7 +519,7 @@ static av_cold int alac_encode_init(AVCodecContext *avctx)
519 519
                                                  avctx->channels,
520 520
                                                  avctx->bits_per_raw_sample);
521 521
 
522
-    avctx->extradata = av_mallocz(ALAC_EXTRADATA_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
522
+    avctx->extradata = av_mallocz(ALAC_EXTRADATA_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
523 523
     if (!avctx->extradata) {
524 524
         ret = AVERROR(ENOMEM);
525 525
         goto error;
... ...
@@ -223,7 +223,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
223 223
 
224 224
     if (!pkt->data &&
225 225
         (ret = av_new_packet(pkt, a->mb_height * a->mb_width * MAX_MB_SIZE +
226
-                             FF_MIN_BUFFER_SIZE)) < 0) {
226
+                             AV_INPUT_BUFFER_MIN_SIZE)) < 0) {
227 227
         av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
228 228
         return ret;
229 229
     }
... ...
@@ -879,7 +879,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
879 879
         return AVERROR(EINVAL);
880 880
 
881 881
     q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +
882
-                                         FF_INPUT_BUFFER_PADDING_SIZE);
882
+                                         AV_INPUT_BUFFER_PADDING_SIZE);
883 883
     if (!q->decoded_bytes_buffer)
884 884
         return AVERROR(ENOMEM);
885 885
 
... ...
@@ -535,15 +535,24 @@ typedef struct AVCodecDescriptor {
535 535
  * Note: If the first 23 bits of the additional bytes are not 0, then damaged
536 536
  * MPEG bitstreams could cause overread and segfault.
537 537
  */
538
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
538
+#define AV_INPUT_BUFFER_PADDING_SIZE 8
539 539
 
540 540
 /**
541 541
  * @ingroup lavc_encoding
542 542
  * minimum encoding buffer size
543 543
  * Used to avoid some checks during header writing.
544 544
  */
545
-#define FF_MIN_BUFFER_SIZE 16384
545
+#define AV_INPUT_BUFFER_MIN_SIZE 16384
546 546
 
547
+/**
548
+ * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead
549
+ */
550
+#define FF_INPUT_BUFFER_PADDING_SIZE 8
551
+
552
+/**
553
+ * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead
554
+ */
555
+#define FF_MIN_BUFFER_SIZE 16384
547 556
 
548 557
 /**
549 558
  * @ingroup lavc_encoding
... ...
@@ -1362,7 +1371,7 @@ typedef struct AVCodecContext {
1362 1362
      * mjpeg: Huffman tables
1363 1363
      * rv10: additional flags
1364 1364
      * mpeg4: global headers (they can be in the bitstream or here)
1365
-     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
1365
+     * The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger
1366 1366
      * than extradata_size to avoid prolems if it is read with the bitstream reader.
1367 1367
      * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
1368 1368
      * - encoding: Set/allocated/freed by libavcodec.
... ...
@@ -3627,7 +3636,7 @@ int av_grow_packet(AVPacket *pkt, int grow_by);
3627 3627
  *        function returns successfully, the data is owned by the underlying AVBuffer.
3628 3628
  *        The caller may not access the data through other means.
3629 3629
  * @param size size of data in bytes, without the padding. I.e. the full buffer
3630
- *        size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE.
3630
+ *        size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE.
3631 3631
  *
3632 3632
  * @return 0 on success, a negative AVERROR on error
3633 3633
  */
... ...
@@ -3843,7 +3852,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
3843 3843
  * returning samples. It is safe to flush even those decoders that are not
3844 3844
  * marked with AV_CODEC_CAP_DELAY, then no samples will be returned.
3845 3845
  *
3846
- * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
3846
+ * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE
3847 3847
  *          larger than the actual read bytes because some optimized bitstream
3848 3848
  *          readers read 32 or 64 bits at once and could read over the end.
3849 3849
  *
... ...
@@ -3883,7 +3892,7 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
3883 3883
  * Some decoders may support multiple frames in a single AVPacket, such
3884 3884
  * decoders would then just decode the first frame.
3885 3885
  *
3886
- * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
3886
+ * @warning The input buffer must be AV_INPUT_BUFFER_PADDING_SIZE larger than
3887 3887
  * the actual read bytes because some optimized bitstream readers read 32 or 64
3888 3888
  * bits at once and could read over the end.
3889 3889
  *
... ...
@@ -4612,7 +4621,7 @@ AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f);
4612 4612
  * Allocate a buffer with padding, reusing the given one if large enough.
4613 4613
  *
4614 4614
  * Same behaviour av_fast_malloc but the buffer has additional
4615
- * FF_INPUT_PADDING_SIZE at the end which will always memset to 0.
4615
+ * AV_INPUT_PADDING_SIZE at the end which will always memset to 0.
4616 4616
  *
4617 4617
  */
4618 4618
 void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
... ...
@@ -66,14 +66,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
66 66
 static int packet_alloc(AVBufferRef **buf, int size)
67 67
 {
68 68
     int ret;
69
-    if ((unsigned)size >= (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
69
+    if ((unsigned)size >= (unsigned)size + AV_INPUT_BUFFER_PADDING_SIZE)
70 70
         return AVERROR(EINVAL);
71 71
 
72
-    ret = av_buffer_realloc(buf, size + FF_INPUT_BUFFER_PADDING_SIZE);
72
+    ret = av_buffer_realloc(buf, size + AV_INPUT_BUFFER_PADDING_SIZE);
73 73
     if (ret < 0)
74 74
         return ret;
75 75
 
76
-    memset((*buf)->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
76
+    memset((*buf)->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
77 77
 
78 78
     return 0;
79 79
 }
... ...
@@ -103,20 +103,20 @@ void av_shrink_packet(AVPacket *pkt, int size)
103 103
     if (pkt->size <= size)
104 104
         return;
105 105
     pkt->size = size;
106
-    memset(pkt->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
106
+    memset(pkt->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
107 107
 }
108 108
 
109 109
 int av_grow_packet(AVPacket *pkt, int grow_by)
110 110
 {
111 111
     int new_size;
112
-    av_assert0((unsigned)pkt->size <= INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE);
112
+    av_assert0((unsigned)pkt->size <= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE);
113 113
     if (!pkt->size)
114 114
         return av_new_packet(pkt, grow_by);
115 115
     if ((unsigned)grow_by >
116
-        INT_MAX - (pkt->size + FF_INPUT_BUFFER_PADDING_SIZE))
116
+        INT_MAX - (pkt->size + AV_INPUT_BUFFER_PADDING_SIZE))
117 117
         return -1;
118 118
 
119
-    new_size = pkt->size + grow_by + FF_INPUT_BUFFER_PADDING_SIZE;
119
+    new_size = pkt->size + grow_by + AV_INPUT_BUFFER_PADDING_SIZE;
120 120
     if (pkt->buf) {
121 121
         int ret = av_buffer_realloc(&pkt->buf, new_size);
122 122
         if (ret < 0)
... ...
@@ -134,17 +134,17 @@ FF_ENABLE_DEPRECATION_WARNINGS
134 134
     }
135 135
     pkt->data  = pkt->buf->data;
136 136
     pkt->size += grow_by;
137
-    memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
137
+    memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
138 138
 
139 139
     return 0;
140 140
 }
141 141
 
142 142
 int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
143 143
 {
144
-    if (size >= INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
144
+    if (size >= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
145 145
         return AVERROR(EINVAL);
146 146
 
147
-    pkt->buf = av_buffer_create(data, size + FF_INPUT_BUFFER_PADDING_SIZE,
147
+    pkt->buf = av_buffer_create(data, size + AV_INPUT_BUFFER_PADDING_SIZE,
148 148
                                 av_buffer_default_free, NULL, 0);
149 149
     if (!pkt->buf)
150 150
         return AVERROR(ENOMEM);
... ...
@@ -172,9 +172,9 @@ do {                                         \
172 172
         void *data;                                                     \
173 173
         if (padding) {                                                  \
174 174
             if ((unsigned)(size) >                                      \
175
-                (unsigned)(size) + FF_INPUT_BUFFER_PADDING_SIZE)        \
175
+                (unsigned)(size) + AV_INPUT_BUFFER_PADDING_SIZE)        \
176 176
                 goto failed_alloc;                                      \
177
-            ALLOC(data, size + FF_INPUT_BUFFER_PADDING_SIZE);           \
177
+            ALLOC(data, size + AV_INPUT_BUFFER_PADDING_SIZE);           \
178 178
         } else {                                                        \
179 179
             ALLOC(data, size);                                          \
180 180
         }                                                               \
... ...
@@ -183,7 +183,7 @@ do {                                         \
183 183
         memcpy(data, src, size);                                        \
184 184
         if (padding)                                                    \
185 185
             memset((uint8_t *)data + size, 0,                           \
186
-                   FF_INPUT_BUFFER_PADDING_SIZE);                       \
186
+                   AV_INPUT_BUFFER_PADDING_SIZE);                       \
187 187
         dst = data;                                                     \
188 188
     } while (0)
189 189
 
... ...
@@ -266,7 +266,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
266 266
 
267 267
     if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
268 268
         return NULL;
269
-    if ((unsigned)size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
269
+    if ((unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
270 270
         return NULL;
271 271
 
272 272
     pkt->side_data = av_realloc(pkt->side_data,
... ...
@@ -274,7 +274,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
274 274
     if (!pkt->side_data)
275 275
         return NULL;
276 276
 
277
-    pkt->side_data[elems].data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
277
+    pkt->side_data[elems].data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
278 278
     if (!pkt->side_data[elems].data)
279 279
         return NULL;
280 280
     pkt->side_data[elems].size = size;
... ...
@@ -302,7 +302,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
302 302
             av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
303 303
             return AVERROR_INVALIDDATA;
304 304
         }
305
-        buf = av_realloc(s->packet_buffer, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
305
+        buf = av_realloc(s->packet_buffer, avpkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
306 306
         if (!buf)
307 307
             return AVERROR(ENOMEM);
308 308
         s->packet_buffer = buf;
... ...
@@ -263,7 +263,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
263 263
 
264 264
     if (encoding) {
265 265
         av_fast_padded_malloc(&c->new_video, &c->new_video_size,
266
-                              h * w + FF_INPUT_BUFFER_PADDING_SIZE);
266
+                              h * w + AV_INPUT_BUFFER_PADDING_SIZE);
267 267
         if (!c->new_video)
268 268
             return AVERROR(ENOMEM);
269 269
         if (c->bpp == 8)
... ...
@@ -1213,11 +1213,11 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
1213 1213
 
1214 1214
     /* Pad the databuffer with:
1215 1215
        DECODE_BYTES_PAD1 or DECODE_BYTES_PAD2 for decode_bytes(),
1216
-       FF_INPUT_BUFFER_PADDING_SIZE, for the bitstreamreader. */
1216
+       AV_INPUT_BUFFER_PADDING_SIZE, for the bitstreamreader. */
1217 1217
     q->decoded_bytes_buffer =
1218 1218
         av_mallocz(avctx->block_align
1219 1219
                    + DECODE_BYTES_PAD1(avctx->block_align)
1220
-                   + FF_INPUT_BUFFER_PADDING_SIZE);
1220
+                   + AV_INPUT_BUFFER_PADDING_SIZE);
1221 1221
     if (!q->decoded_bytes_buffer)
1222 1222
         return AVERROR(ENOMEM);
1223 1223
 
... ...
@@ -113,7 +113,7 @@ static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration,
113 113
                             int *sample_rate, int *framesize)
114 114
 {
115 115
     GetBitContext gb;
116
-    uint8_t hdr[12 + FF_INPUT_BUFFER_PADDING_SIZE] = { 0 };
116
+    uint8_t hdr[12 + AV_INPUT_BUFFER_PADDING_SIZE] = { 0 };
117 117
     int ret, sample_blocks, sr_code;
118 118
 
119 119
     if (buf_size < 12)
... ...
@@ -65,7 +65,7 @@ typedef struct DssSpContext {
65 65
     int pulse_dec_mode;
66 66
 
67 67
     DECLARE_ALIGNED(16, uint8_t, bits)[DSS_SP_FRAME_SIZE +
68
-                                       FF_INPUT_BUFFER_PADDING_SIZE];
68
+                                       AV_INPUT_BUFFER_PADDING_SIZE];
69 69
 } DssSpContext;
70 70
 
71 71
 /*
... ...
@@ -36,12 +36,12 @@ static int dump_extradata(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx,
36 36
             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
37 37
             int size= buf_size + avctx->extradata_size;
38 38
             *poutbuf_size= size;
39
-            *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
39
+            *poutbuf= av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
40 40
             if (!*poutbuf)
41 41
                 return AVERROR(ENOMEM);
42 42
 
43 43
             memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
44
-            memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
44
+            memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
45 45
             return 1;
46 46
         }
47 47
     }
... ...
@@ -167,8 +167,8 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
167 167
     GetBitContext gb;
168 168
     BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1;
169 169
     LOCAL_ALIGNED_16(int16_t, sblock, [5 * DV_MAX_BPM], [64]);
170
-    LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [80     + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
171
-    LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [80 * 5 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
170
+    LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [80     + AV_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
171
+    LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [80 * 5 + AV_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
172 172
     const int log2_blocksize = 3;
173 173
     int is_field_mode[5];
174 174
 
... ...
@@ -940,7 +940,7 @@ static int ffv1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
940 940
 
941 941
     if ((ret = ff_alloc_packet(pkt, avctx->width * avctx->height *
942 942
                              ((8 * 2 + 1 + 1) * 4) / 8 +
943
-                             FF_MIN_BUFFER_SIZE)) < 0) {
943
+                             AV_INPUT_BUFFER_MIN_SIZE)) < 0) {
944 944
         av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
945 945
         return ret;
946 946
     }
... ...
@@ -294,10 +294,10 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
294 294
     const int ridx = swapuv ? 2 : 0;
295 295
 
296 296
     if ((ret = av_reallocp(&c->buf,
297
-                           src_size + FF_INPUT_BUFFER_PADDING_SIZE)) < 0)
297
+                           src_size + AV_INPUT_BUFFER_PADDING_SIZE)) < 0)
298 298
         return ret;
299 299
     jpg_unescape(src, src_size, c->buf, &unesc_size);
300
-    memset(c->buf + unesc_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
300
+    memset(c->buf + unesc_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
301 301
     init_get_bits(&gb, c->buf, unesc_size * 8);
302 302
 
303 303
     width = FFALIGN(width, 16);
... ...
@@ -1170,7 +1170,7 @@ static int g2m_init_buffers(G2MContext *c)
1170 1170
         c->synth_tile  = av_mallocz(c->tile_stride      * aligned_height);
1171 1171
         c->jpeg_tile   = av_mallocz(c->tile_stride      * aligned_height);
1172 1172
         c->kempf_buf   = av_mallocz((c->tile_width + 1) * aligned_height +
1173
-                                    FF_INPUT_BUFFER_PADDING_SIZE);
1173
+                                    AV_INPUT_BUFFER_PADDING_SIZE);
1174 1174
         c->kempf_flags = av_mallocz(c->tile_width       * aligned_height);
1175 1175
         if (!c->synth_tile || !c->jpeg_tile ||
1176 1176
             !c->kempf_buf || !c->kempf_flags)
... ...
@@ -367,7 +367,7 @@ static inline int check_marker(GetBitContext *s, const char *msg)
367 367
 
368 368
 /**
369 369
  * Initialize GetBitContext.
370
- * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
370
+ * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes
371 371
  *        larger than the actual read bits because some optimized bitstream
372 372
  *        readers read 32 or 64 bit at once and could read over the end
373 373
  * @param bit_size the size of the buffer in bits
... ...
@@ -400,7 +400,7 @@ static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
400 400
 
401 401
 /**
402 402
  * Initialize GetBitContext.
403
- * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
403
+ * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes
404 404
  *        larger than the actual read bits because some optimized bitstream
405 405
  *        readers read 32 or 64 bit at once and could read over the end
406 406
  * @param byte_size the size of the buffer in bytes
... ...
@@ -153,7 +153,7 @@ static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
153 153
     uint8_t *outbuf_ptr, *end;
154 154
     int ret;
155 155
 
156
-    if ((ret = ff_alloc_packet(pkt, avctx->width*avctx->height*7/5 + FF_MIN_BUFFER_SIZE)) < 0) {
156
+    if ((ret = ff_alloc_packet(pkt, avctx->width*avctx->height*7/5 + AV_INPUT_BUFFER_MIN_SIZE)) < 0) {
157 157
         av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
158 158
         return ret;
159 159
     }
... ...
@@ -275,7 +275,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, H264SliceContext *sl,
275 275
     }
276 276
 
277 277
     av_fast_malloc(&sl->rbsp_buffer, &sl->rbsp_buffer_size,
278
-                   length + FF_INPUT_BUFFER_PADDING_SIZE);
278
+                   length + AV_INPUT_BUFFER_PADDING_SIZE);
279 279
     dst = sl->rbsp_buffer;
280 280
 
281 281
     if (!dst)
... ...
@@ -304,7 +304,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, H264SliceContext *sl,
304 304
         dst[di++] = src[si++];
305 305
 
306 306
 nsc:
307
-    memset(dst + di, 0, FF_INPUT_BUFFER_PADDING_SIZE);
307
+    memset(dst + di, 0, AV_INPUT_BUFFER_PADDING_SIZE);
308 308
 
309 309
     *dst_length = di;
310 310
     *consumed   = si + 1; // +1 for the header
... ...
@@ -41,7 +41,7 @@ static int alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size,
41 41
 
42 42
     *poutbuf_size += sps_pps_size + in_size + nal_header_size;
43 43
     if ((err = av_reallocp(poutbuf,
44
-                           *poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
44
+                           *poutbuf_size + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
45 45
         *poutbuf_size = 0;
46 46
         return err;
47 47
     }
... ...
@@ -109,7 +109,7 @@ static int h264_extradata_to_annexb(AVCodecContext *avctx, const int padding)
109 109
     }
110 110
 
111 111
     if (out)
112
-        memset(out + total_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
112
+        memset(out + total_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
113 113
 
114 114
     if (!sps_seen)
115 115
         av_log(avctx, AV_LOG_WARNING,
... ...
@@ -150,7 +150,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
150 150
 
151 151
     /* retrieve sps and pps NAL units from extradata */
152 152
     if (!ctx->extradata_parsed) {
153
-        ret = h264_extradata_to_annexb(avctx, FF_INPUT_BUFFER_PADDING_SIZE);
153
+        ret = h264_extradata_to_annexb(avctx, AV_INPUT_BUFFER_PADDING_SIZE);
154 154
         if (ret < 0)
155 155
             return ret;
156 156
         ctx->length_size      = ret;
... ...
@@ -67,18 +67,18 @@ static int hevc_extradata_to_annexb(AVCodecContext *avctx)
67 67
         for (j = 0; j < cnt; j++) {
68 68
             int nalu_len = bytestream2_get_be16(&gb);
69 69
 
70
-            if (4 + FF_INPUT_BUFFER_PADDING_SIZE + nalu_len > SIZE_MAX - new_extradata_size) {
70
+            if (4 + AV_INPUT_BUFFER_PADDING_SIZE + nalu_len > SIZE_MAX - new_extradata_size) {
71 71
                 ret = AVERROR_INVALIDDATA;
72 72
                 goto fail;
73 73
             }
74
-            ret = av_reallocp(&new_extradata, new_extradata_size + nalu_len + 4 + FF_INPUT_BUFFER_PADDING_SIZE);
74
+            ret = av_reallocp(&new_extradata, new_extradata_size + nalu_len + 4 + AV_INPUT_BUFFER_PADDING_SIZE);
75 75
             if (ret < 0)
76 76
                 goto fail;
77 77
 
78 78
             AV_WB32(new_extradata + new_extradata_size, 1); // add the startcode
79 79
             bytestream2_get_buffer(&gb, new_extradata + new_extradata_size + 4, nalu_len);
80 80
             new_extradata_size += 4 + nalu_len;
81
-            memset(new_extradata + new_extradata_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
81
+            memset(new_extradata + new_extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
82 82
         }
83 83
     }
84 84
 
... ...
@@ -89,7 +89,7 @@ int ff_hevc_extract_rbsp(const uint8_t *src, int length,
89 89
     }
90 90
 
91 91
     av_fast_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size,
92
-                   length + FF_INPUT_BUFFER_PADDING_SIZE);
92
+                   length + AV_INPUT_BUFFER_PADDING_SIZE);
93 93
     if (!nal->rbsp_buffer)
94 94
         return AVERROR(ENOMEM);
95 95
 
... ...
@@ -119,7 +119,7 @@ int ff_hevc_extract_rbsp(const uint8_t *src, int length,
119 119
         dst[di++] = src[si++];
120 120
 
121 121
 nsc:
122
-    memset(dst + di, 0, FF_INPUT_BUFFER_PADDING_SIZE);
122
+    memset(dst + di, 0, AV_INPUT_BUFFER_PADDING_SIZE);
123 123
 
124 124
     nal->data = dst;
125 125
     nal->size = di;
... ...
@@ -35,14 +35,14 @@
35 35
 #include "thread.h"
36 36
 
37 37
 #define classic_shift_luma_table_size 42
38
-static const unsigned char classic_shift_luma[classic_shift_luma_table_size + FF_INPUT_BUFFER_PADDING_SIZE] = {
38
+static const unsigned char classic_shift_luma[classic_shift_luma_table_size + AV_INPUT_BUFFER_PADDING_SIZE] = {
39 39
     34, 36, 35, 69, 135, 232,   9, 16, 10, 24,  11,  23,  12,  16, 13, 10,
40 40
     14,  8, 15,  8,  16,   8,  17, 20, 16, 10, 207, 206, 205, 236, 11,  8,
41 41
     10, 21,  9, 23,   8,   8, 199, 70, 69, 68,   0
42 42
 };
43 43
 
44 44
 #define classic_shift_chroma_table_size 59
45
-static const unsigned char classic_shift_chroma[classic_shift_chroma_table_size + FF_INPUT_BUFFER_PADDING_SIZE] = {
45
+static const unsigned char classic_shift_chroma[classic_shift_chroma_table_size + AV_INPUT_BUFFER_PADDING_SIZE] = {
46 46
     66, 36,  37,  38, 39, 40,  41,  75,  76,  77, 110, 239, 144, 81, 82,  83,
47 47
     84, 85, 118, 183, 56, 57,  88,  89,  56,  89, 154,  57,  58, 57, 26, 141,
48 48
     57, 56,  58,  57, 58, 57, 184, 119, 214, 245, 116,  83,  82, 49, 80,  79,
... ...
@@ -511,11 +511,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
511 511
 
512 512
     av_fast_malloc(&s->bitstream_buffer,
513 513
                    &s->bitstream_buffer_size,
514
-                   buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
514
+                   buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
515 515
     if (!s->bitstream_buffer)
516 516
         return AVERROR(ENOMEM);
517 517
 
518
-    memset(s->bitstream_buffer + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
518
+    memset(s->bitstream_buffer + buf_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
519 519
     s->bdsp.bswap_buf((uint32_t *) s->bitstream_buffer,
520 520
                       (const uint32_t *) buf, buf_size / 4);
521 521
 
... ...
@@ -453,7 +453,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
453 453
     int i, j, size = 0, ret;
454 454
 
455 455
     if (!pkt->data &&
456
-        (ret = av_new_packet(pkt, width * height * 3 * 4 + FF_MIN_BUFFER_SIZE)) < 0) {
456
+        (ret = av_new_packet(pkt, width * height * 3 * 4 + AV_INPUT_BUFFER_MIN_SIZE)) < 0) {
457 457
         av_log(avctx, AV_LOG_ERROR, "Error allocating output packet.\n");
458 458
         return ret;
459 459
     }
... ...
@@ -172,7 +172,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
172 172
     if ((err = av_image_check_size(avctx->width, avctx->height, 0, avctx)))
173 173
         return err;
174 174
     s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary
175
-    s->planebuf  = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE);
175
+    s->planebuf  = av_malloc(s->planesize + AV_INPUT_BUFFER_PADDING_SIZE);
176 176
     if (!s->planebuf)
177 177
         return AVERROR(ENOMEM);
178 178
 
... ...
@@ -997,7 +997,7 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
997 997
 
998 998
     IMCContext *q = avctx->priv_data;
999 999
 
1000
-    LOCAL_ALIGNED_16(uint16_t, buf16, [(IMC_BLOCK_SIZE + FF_INPUT_BUFFER_PADDING_SIZE) / 2]);
1000
+    LOCAL_ALIGNED_16(uint16_t, buf16, [(IMC_BLOCK_SIZE + AV_INPUT_BUFFER_PADDING_SIZE) / 2]);
1001 1001
 
1002 1002
     if (buf_size < IMC_BLOCK_SIZE * avctx->channels) {
1003 1003
         av_log(avctx, AV_LOG_ERROR, "frame too small!\n");
... ...
@@ -42,7 +42,7 @@ static int imx_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx
42 42
         return 0;
43 43
     }
44 44
 
45
-    *poutbuf = av_malloc(buf_size + 20 + FF_INPUT_BUFFER_PADDING_SIZE);
45
+    *poutbuf = av_malloc(buf_size + 20 + AV_INPUT_BUFFER_PADDING_SIZE);
46 46
     if (!*poutbuf)
47 47
         return AVERROR(ENOMEM);
48 48
     poutbufp = *poutbuf;
... ...
@@ -157,7 +157,7 @@ int avpriv_unlock_avformat(void);
157 157
  * This value was chosen such that every bit of the buffer is
158 158
  * addressable by a 32-bit signed integer as used by get_bits.
159 159
  */
160
-#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE)
160
+#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - AV_INPUT_BUFFER_PADDING_SIZE)
161 161
 
162 162
 /**
163 163
  * Check AVPacket size and/or allocate data.
... ...
@@ -268,7 +268,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
268 268
         comps = 3;
269 269
 
270 270
     if ((ret = ff_alloc_packet(pkt, avctx->width * avctx->height * comps * 4 +
271
-                               FF_MIN_BUFFER_SIZE)) < 0) {
271
+                               AV_INPUT_BUFFER_MIN_SIZE)) < 0) {
272 272
         av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
273 273
         return ret;
274 274
     }
... ...
@@ -54,7 +54,7 @@ static int dcadec_decode_frame(AVCodecContext *avctx, void *data,
54 54
     }
55 55
     mrk = AV_RB32(input);
56 56
     if (mrk != DCA_SYNCWORD_CORE_BE && mrk != DCA_SYNCWORD_SUBSTREAM) {
57
-        s->buffer = av_fast_realloc(s->buffer, &s->buffer_size, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
57
+        s->buffer = av_fast_realloc(s->buffer, &s->buffer_size, avpkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
58 58
         if (!s->buffer)
59 59
             return AVERROR(ENOMEM);
60 60
 
... ...
@@ -139,7 +139,7 @@ static av_cold int Faac_encode_init(AVCodecContext *avctx)
139 139
 
140 140
         if (!faacEncGetDecoderSpecificInfo(s->faac_handle, &buffer,
141 141
                                            &decoder_specific_info_size)) {
142
-            avctx->extradata = av_malloc(decoder_specific_info_size + FF_INPUT_BUFFER_PADDING_SIZE);
142
+            avctx->extradata = av_malloc(decoder_specific_info_size + AV_INPUT_BUFFER_PADDING_SIZE);
143 143
             if (!avctx->extradata) {
144 144
                 ret = AVERROR(ENOMEM);
145 145
                 goto error;
... ...
@@ -292,7 +292,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
292 292
     if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
293 293
         avctx->extradata_size = info.confSize;
294 294
         avctx->extradata      = av_mallocz(avctx->extradata_size +
295
-                                           FF_INPUT_BUFFER_PADDING_SIZE);
295
+                                           AV_INPUT_BUFFER_PADDING_SIZE);
296 296
         if (!avctx->extradata) {
297 297
             ret = AVERROR(ENOMEM);
298 298
             goto error;
... ...
@@ -143,7 +143,7 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
143 143
         (*s->encoder)->EncodeParameterSets(s->encoder, &fbi);
144 144
         for (i = 0; i < fbi.sLayerInfo[0].iNalCount; i++)
145 145
             size += fbi.sLayerInfo[0].pNalLengthInByte[i];
146
-        avctx->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
146
+        avctx->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
147 147
         if (!avctx->extradata) {
148 148
             err = AVERROR(ENOMEM);
149 149
             goto fail;
... ...
@@ -262,7 +262,7 @@ static int av_cold libopus_encode_init(AVCodecContext *avctx)
262 262
     }
263 263
 
264 264
     header_size = 19 + (avctx->channels > 2 ? 2 + avctx->channels : 0);
265
-    avctx->extradata = av_malloc(header_size + FF_INPUT_BUFFER_PADDING_SIZE);
265
+    avctx->extradata = av_malloc(header_size + AV_INPUT_BUFFER_PADDING_SIZE);
266 266
     if (!avctx->extradata) {
267 267
         av_log(avctx, AV_LOG_ERROR, "Failed to allocate extradata.\n");
268 268
         ret = AVERROR(ENOMEM);
... ...
@@ -244,7 +244,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
244 244
     header_data = speex_header_to_packet(&s->header, &header_size);
245 245
 
246 246
     /* allocate extradata */
247
-    avctx->extradata = av_malloc(header_size + FF_INPUT_BUFFER_PADDING_SIZE);
247
+    avctx->extradata = av_malloc(header_size + AV_INPUT_BUFFER_PADDING_SIZE);
248 248
     if (!avctx->extradata) {
249 249
         speex_header_free(header_data);
250 250
         speex_encoder_destroy(s->enc_state);
... ...
@@ -105,7 +105,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
105 105
     if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
106 106
         avctx->extradata_size = 2;
107 107
         avctx->extradata      = av_mallocz(avctx->extradata_size +
108
-                                           FF_INPUT_BUFFER_PADDING_SIZE);
108
+                                           AV_INPUT_BUFFER_PADDING_SIZE);
109 109
         if (!avctx->extradata) {
110 110
             ret = AVERROR(ENOMEM);
111 111
             goto error;
... ...
@@ -206,7 +206,7 @@ static av_cold int libvorbis_encode_init(AVCodecContext *avctx)
206 206
                                 xiph_len(header_comm.bytes) +
207 207
                                 header_code.bytes;
208 208
     p = avctx->extradata = av_malloc(avctx->extradata_size +
209
-                                     FF_INPUT_BUFFER_PADDING_SIZE);
209
+                                     AV_INPUT_BUFFER_PADDING_SIZE);
210 210
     if (!p) {
211 211
         ret = AVERROR(ENOMEM);
212 212
         goto error;
... ...
@@ -225,7 +225,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
225 225
             return AVERROR_INVALIDDATA;
226 226
         }
227 227
 
228
-        avctx->extradata = av_malloc(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
228
+        avctx->extradata = av_malloc(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
229 229
         if (!avctx->extradata) {
230 230
             av_log(avctx, AV_LOG_ERROR,
231 231
                    "Cannot allocate HEVC header of size %d.\n", avctx->extradata_size);
... ...
@@ -81,7 +81,7 @@ static int encode_nals(AVCodecContext *ctx, AVPacket *pkt,
81 81
 {
82 82
     XavsContext *x4 = ctx->priv_data;
83 83
     uint8_t *p;
84
-    int i, s, ret, size = x4->sei_size + FF_MIN_BUFFER_SIZE;
84
+    int i, s, ret, size = x4->sei_size + AV_INPUT_BUFFER_MIN_SIZE;
85 85
 
86 86
     if (!nnal)
87 87
         return 0;
... ...
@@ -688,7 +688,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
688 688
     xvid_enc_stats_t xvid_enc_stats = { 0 };
689 689
 
690 690
     if (!user_packet &&
691
-        (ret = av_new_packet(pkt, mb_width * mb_height * MAX_MB_BYTES + FF_MIN_BUFFER_SIZE)) < 0) {
691
+        (ret = av_new_packet(pkt, mb_width * mb_height * MAX_MB_BYTES + AV_INPUT_BUFFER_MIN_SIZE)) < 0) {
692 692
         av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
693 693
         return ret;
694 694
     }
... ...
@@ -211,7 +211,7 @@ static int ljpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
211 211
     const int height = avctx->height;
212 212
     const int mb_width  = (width  + s->hsample[0] - 1) / s->hsample[0];
213 213
     const int mb_height = (height + s->vsample[0] - 1) / s->vsample[0];
214
-    int max_pkt_size = FF_MIN_BUFFER_SIZE;
214
+    int max_pkt_size = AV_INPUT_BUFFER_MIN_SIZE;
215 215
     int ret, header_bits;
216 216
 
217 217
     if (avctx->pix_fmt == AV_PIX_FMT_BGR24)
... ...
@@ -181,7 +181,7 @@ static int decode_frame(AVCodecContext *avctx,
181 181
     frame.f->pict_type = AV_PICTURE_TYPE_I;
182 182
     frame.f->key_frame = 1;
183 183
 
184
-    av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
184
+    av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
185 185
     if (!a->bitstream_buffer)
186 186
         return AVERROR(ENOMEM);
187 187
     for (i = 0; i < buf_size; i += 2) {
... ...
@@ -44,7 +44,7 @@ static int mjpega_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *av
44 44
     }
45 45
 
46 46
     *poutbuf_size = 0;
47
-    *poutbuf = av_malloc(buf_size + 44 + FF_INPUT_BUFFER_PADDING_SIZE);
47
+    *poutbuf = av_malloc(buf_size + 44 + AV_INPUT_BUFFER_PADDING_SIZE);
48 48
     if (!*poutbuf)
49 49
         return AVERROR(ENOMEM);
50 50
     poutbufp = *poutbuf;
... ...
@@ -1422,7 +1422,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
1422 1422
         *unescaped_buf_ptr  = s->buffer;
1423 1423
         *unescaped_buf_size = dst - s->buffer;
1424 1424
         memset(s->buffer + *unescaped_buf_size, 0,
1425
-               FF_INPUT_BUFFER_PADDING_SIZE);
1425
+               AV_INPUT_BUFFER_PADDING_SIZE);
1426 1426
 
1427 1427
         av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %td bytes\n",
1428 1428
                (buf_end - *buf_ptr) - (dst - s->buffer));
... ...
@@ -1465,7 +1465,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
1465 1465
         *unescaped_buf_ptr  = dst;
1466 1466
         *unescaped_buf_size = (bit_count + 7) >> 3;
1467 1467
         memset(s->buffer + *unescaped_buf_size, 0,
1468
-               FF_INPUT_BUFFER_PADDING_SIZE);
1468
+               AV_INPUT_BUFFER_PADDING_SIZE);
1469 1469
     } else {
1470 1470
         *unescaped_buf_ptr  = *buf_ptr;
1471 1471
         *unescaped_buf_size = buf_end - *buf_ptr;
... ...
@@ -274,14 +274,14 @@ static int mp_decode_frame(AVCodecContext *avctx,
274 274
     }
275 275
 
276 276
     /* le32 bitstream msb first */
277
-    av_fast_malloc(&mp->bswapbuf, &mp->bswapbuf_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
277
+    av_fast_malloc(&mp->bswapbuf, &mp->bswapbuf_size, buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
278 278
     if (!mp->bswapbuf)
279 279
         return AVERROR(ENOMEM);
280 280
     mp->bdsp.bswap_buf((uint32_t *) mp->bswapbuf, (const uint32_t *) buf,
281 281
                        buf_size / 4);
282 282
     if (buf_size & 3)
283 283
         memcpy(mp->bswapbuf + (buf_size & ~3), buf + (buf_size & ~3), buf_size & 3);
284
-    memset(mp->bswapbuf + buf_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
284
+    memset(mp->bswapbuf + buf_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
285 285
     init_get_bits(&gb, mp->bswapbuf, buf_size * 8);
286 286
 
287 287
     memset(mp->changes_map, 0, avctx->width * avctx->height);
... ...
@@ -28,7 +28,7 @@ static int text2movsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, co
28 28
                      const uint8_t *buf, int buf_size, int keyframe){
29 29
     if (buf_size > 0xffff) return 0;
30 30
     *poutbuf_size = buf_size + 2;
31
-    *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
31
+    *poutbuf = av_malloc(*poutbuf_size + AV_INPUT_BUFFER_PADDING_SIZE);
32 32
     if (!*poutbuf)
33 33
         return AVERROR(ENOMEM);
34 34
     AV_WB16(*poutbuf, buf_size);
... ...
@@ -47,7 +47,7 @@ static int mov2textsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, co
47 47
                      const uint8_t *buf, int buf_size, int keyframe){
48 48
     if (buf_size < 2) return 0;
49 49
     *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
50
-    *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
50
+    *poutbuf = av_malloc(*poutbuf_size + AV_INPUT_BUFFER_PADDING_SIZE);
51 51
     if (!*poutbuf)
52 52
         return AVERROR(ENOMEM);
53 53
     memcpy(*poutbuf, buf + 2, *poutbuf_size);
... ...
@@ -2516,7 +2516,7 @@ int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
2516 2516
             av_fast_malloc(&s->bitstream_buffer,
2517 2517
                            &s->allocated_bitstream_buffer_size,
2518 2518
                            buf_size - current_pos +
2519
-                           FF_INPUT_BUFFER_PADDING_SIZE);
2519
+                           AV_INPUT_BUFFER_PADDING_SIZE);
2520 2520
             if (!s->bitstream_buffer)
2521 2521
                 return AVERROR(ENOMEM);
2522 2522
             memcpy(s->bitstream_buffer, buf + current_pos,
... ...
@@ -544,7 +544,7 @@ do {\
544 544
 
545 545
     if (s1->bitstream_buffer) {
546 546
         if (s1->bitstream_buffer_size +
547
-            FF_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size)
547
+            AV_INPUT_BUFFER_PADDING_SIZE > s->allocated_bitstream_buffer_size)
548 548
             av_fast_malloc(&s->bitstream_buffer,
549 549
                            &s->allocated_bitstream_buffer_size,
550 550
                            s1->allocated_bitstream_buffer_size);
... ...
@@ -552,7 +552,7 @@ do {\
552 552
         memcpy(s->bitstream_buffer, s1->bitstream_buffer,
553 553
                s1->bitstream_buffer_size);
554 554
         memset(s->bitstream_buffer + s->bitstream_buffer_size, 0,
555
-               FF_INPUT_BUFFER_PADDING_SIZE);
555
+               AV_INPUT_BUFFER_PADDING_SIZE);
556 556
     }
557 557
 
558 558
     // linesize dependend scratch buffer allocation
... ...
@@ -476,7 +476,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
476 476
     Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r;
477 477
     int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
478 478
 
479
-    av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
479
+    av_assert0(AV_INPUT_BUFFER_PADDING_SIZE >=
480 480
                ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
481 481
 
482 482
     init_get_bits(&gb, buf, buf_size * 8);
... ...
@@ -32,10 +32,10 @@ static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const ch
32 32
     int amount= args ? atoi(args) : (*state % 10001+1);
33 33
     int i;
34 34
 
35
-    *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
35
+    *poutbuf= av_malloc(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
36 36
     if (!*poutbuf)
37 37
         return AVERROR(ENOMEM);
38
-    memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
38
+    memcpy(*poutbuf, buf, buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
39 39
     for(i=0; i<buf_size; i++){
40 40
         (*state) += (*poutbuf)[i] + 1;
41 41
         if(*state % amount == 0)
... ...
@@ -128,7 +128,7 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height,
128 128
         avctx->height = c->height = height;
129 129
         ptr = av_fast_realloc(c->decomp_buf, &c->decomp_size,
130 130
                               c->height * c->width * 3 / 2 +
131
-                              FF_INPUT_BUFFER_PADDING_SIZE +
131
+                              AV_INPUT_BUFFER_PADDING_SIZE +
132 132
                               RTJPEG_HEADER_SIZE);
133 133
         if (!ptr) {
134 134
             av_log(avctx, AV_LOG_ERROR,
... ...
@@ -202,7 +202,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
202 202
     buf       = &buf[12];
203 203
     buf_size -= 12;
204 204
     if (comptype == NUV_RTJPEG_IN_LZO || comptype == NUV_LZO) {
205
-        int outlen = c->decomp_size - FF_INPUT_BUFFER_PADDING_SIZE;
205
+        int outlen = c->decomp_size - AV_INPUT_BUFFER_PADDING_SIZE;
206 206
         int inlen  = buf_size;
207 207
         if (av_lzo1x_decode(c->decomp_buf, &outlen, buf, &inlen)) {
208 208
             av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
... ...
@@ -747,7 +747,7 @@ static int nvenc_setup_extradata(AVCodecContext *avctx)
747 747
     NV_ENC_SEQUENCE_PARAM_PAYLOAD payload = { 0 };
748 748
     int ret;
749 749
 
750
-    avctx->extradata = av_mallocz(EXTRADATA_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
750
+    avctx->extradata = av_mallocz(EXTRADATA_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
751 751
     if (!avctx->extradata)
752 752
         return AVERROR(ENOMEM);
753 753
 
... ...
@@ -203,7 +203,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
203 203
             memset(((uint8_t *) dest->obj) + size, 0, pad); \
204 204
     }
205 205
     alloc_and_copy_or_fail(extradata,    src->extradata_size,
206
-                           FF_INPUT_BUFFER_PADDING_SIZE);
206
+                           AV_INPUT_BUFFER_PADDING_SIZE);
207 207
     alloc_and_copy_or_fail(intra_matrix, 64 * sizeof(int16_t), 0);
208 208
     alloc_and_copy_or_fail(inter_matrix, 64 * sizeof(int16_t), 0);
209 209
     alloc_and_copy_or_fail(rc_override,  src->rc_override_count * sizeof(*src->rc_override), 0);
... ...
@@ -126,7 +126,7 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
126 126
                      int64_t pts, int64_t dts, int64_t pos)
127 127
 {
128 128
     int index, i;
129
-    uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE];
129
+    uint8_t dummy_buf[AV_INPUT_BUFFER_PADDING_SIZE];
130 130
 
131 131
     if (!(s->flags & PARSER_FLAG_FETCHED_OFFSET)) {
132 132
         s->next_frame_offset =
... ...
@@ -195,13 +195,13 @@ int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx,
195 195
             int size = buf_size + avctx->extradata_size;
196 196
 
197 197
             *poutbuf_size = size;
198
-            *poutbuf      = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
198
+            *poutbuf      = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
199 199
             if (!*poutbuf)
200 200
                 return AVERROR(ENOMEM);
201 201
 
202 202
             memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
203 203
             memcpy(*poutbuf + avctx->extradata_size, buf,
204
-                   buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
204
+                   buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
205 205
             return 1;
206 206
         }
207 207
     }
... ...
@@ -243,7 +243,7 @@ int ff_combine_frame(ParseContext *pc, int next,
243 243
     if (next == END_NOT_FOUND) {
244 244
         void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
245 245
                                            *buf_size + pc->index +
246
-                                           FF_INPUT_BUFFER_PADDING_SIZE);
246
+                                           AV_INPUT_BUFFER_PADDING_SIZE);
247 247
 
248 248
         if (!new_buffer)
249 249
             return AVERROR(ENOMEM);
... ...
@@ -260,14 +260,14 @@ int ff_combine_frame(ParseContext *pc, int next,
260 260
     if (pc->index) {
261 261
         void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
262 262
                                            next + pc->index +
263
-                                           FF_INPUT_BUFFER_PADDING_SIZE);
263
+                                           AV_INPUT_BUFFER_PADDING_SIZE);
264 264
 
265 265
         if (!new_buffer)
266 266
             return AVERROR(ENOMEM);
267 267
         pc->buffer = new_buffer;
268
-        if (next > -FF_INPUT_BUFFER_PADDING_SIZE)
268
+        if (next > -AV_INPUT_BUFFER_PADDING_SIZE)
269 269
             memcpy(&pc->buffer[pc->index], *buf,
270
-                   next + FF_INPUT_BUFFER_PADDING_SIZE);
270
+                   next + AV_INPUT_BUFFER_PADDING_SIZE);
271 271
         pc->index = 0;
272 272
         *buf      = pc->buffer;
273 273
     }
... ...
@@ -297,7 +297,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
297 297
     enc_row_size    = deflateBound(&s->zstream, row_size);
298 298
     max_packet_size = avctx->height * (enc_row_size +
299 299
                                        ((enc_row_size + IOBUF_SIZE - 1) / IOBUF_SIZE) * 12)
300
-                      + FF_MIN_BUFFER_SIZE;
300
+                      + AV_INPUT_BUFFER_MIN_SIZE;
301 301
     if (!pkt->data &&
302 302
         (ret = av_new_packet(pkt, max_packet_size)) < 0) {
303 303
         av_log(avctx, AV_LOG_ERROR, "Could not allocate output packet of size %d.\n",
... ...
@@ -55,7 +55,7 @@ retry:
55 55
             goto retry;
56 56
         }
57 57
 #if 0
58
-        if (pc->index && pc->index * 2 + FF_INPUT_BUFFER_PADDING_SIZE < pc->buffer_size && buf_size > pc->index) {
58
+        if (pc->index && pc->index * 2 + AV_INPUT_BUFFER_PADDING_SIZE < pc->buffer_size && buf_size > pc->index) {
59 59
             memcpy(pc->buffer + pc->index, buf, pc->index);
60 60
             pc->index += pc->index;
61 61
             buf       += pc->index;
... ...
@@ -948,7 +948,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
948 948
 
949 949
     pkt_size = ctx->frame_size_upper_bound;
950 950
 
951
-    if ((ret = ff_alloc_packet(pkt, pkt_size + FF_MIN_BUFFER_SIZE)) < 0) {
951
+    if ((ret = ff_alloc_packet(pkt, pkt_size + AV_INPUT_BUFFER_MIN_SIZE)) < 0) {
952 952
         av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
953 953
         return ret;
954 954
     }
... ...
@@ -341,7 +341,7 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
341 341
             return AVERROR(ENOMEM);
342 342
 
343 343
         if (avctx->extradata) {
344
-            q->avctx_internal->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
344
+            q->avctx_internal->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
345 345
             if (!q->avctx_internal->extradata)
346 346
                 return AVERROR(ENOMEM);
347 347
 
... ...
@@ -177,7 +177,7 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q)
177 177
     }
178 178
 
179 179
     avctx->extradata = av_malloc(extradata.SPSBufSize + need_pps * extradata.PPSBufSize +
180
-                                 FF_INPUT_BUFFER_PADDING_SIZE);
180
+                                 AV_INPUT_BUFFER_PADDING_SIZE);
181 181
     if (!avctx->extradata)
182 182
         return AVERROR(ENOMEM);
183 183
 
... ...
@@ -185,7 +185,7 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q)
185 185
     if (need_pps)
186 186
         memcpy(avctx->extradata + extradata.SPSBufSize, pps_buf, extradata.PPSBufSize);
187 187
     avctx->extradata_size = extradata.SPSBufSize + need_pps * extradata.PPSBufSize;
188
-    memset(avctx->extradata + avctx->extradata_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
188
+    memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
189 189
 
190 190
     return 0;
191 191
 }
... ...
@@ -140,7 +140,7 @@ static int generate_fake_vps(QSVEncContext *q, AVCodecContext *avctx)
140 140
     }
141 141
 
142 142
     vps_size = bytestream2_tell_p(&pbc);
143
-    new_extradata = av_mallocz(vps_size + avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
143
+    new_extradata = av_mallocz(vps_size + avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
144 144
     if (!new_extradata)
145 145
         return AVERROR(ENOMEM);
146 146
     memcpy(new_extradata, vps_buf, vps_size);
... ...
@@ -431,7 +431,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
431 431
         void *tmp_ptr;
432 432
         s->max_framesize = 1024; // should hopefully be enough for the first header
433 433
         tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
434
-                                  s->max_framesize + FF_INPUT_BUFFER_PADDING_SIZE);
434
+                                  s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
435 435
         if (!tmp_ptr) {
436 436
             av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
437 437
             return AVERROR(ENOMEM);
... ...
@@ -33,7 +33,7 @@ int ff_startcode_find_candidate_c(const uint8_t *buf, int size)
33 33
     int i = 0;
34 34
 #if HAVE_FAST_UNALIGNED
35 35
     /* we check i < size instead of i + 3 / 7 because it is
36
-     * simpler and there must be FF_INPUT_BUFFER_PADDING_SIZE
36
+     * simpler and there must be AV_INPUT_BUFFER_PADDING_SIZE
37 37
      * bytes at the end.
38 38
      */
39 39
 #if HAVE_FAST_64BIT
... ...
@@ -586,7 +586,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
586 586
 
587 587
     if (!pkt->data &&
588 588
         (ret = av_new_packet(pkt, s->y_block_width * s->y_block_height *
589
-                             MAX_MB_BYTES * 3 + FF_MIN_BUFFER_SIZE)) < 0) {
589
+                             MAX_MB_BYTES * 3 + AV_INPUT_BUFFER_MIN_SIZE)) < 0) {
590 590
         av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
591 591
         return ret;
592 592
     }
... ...
@@ -141,7 +141,7 @@ static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,
141 141
 {
142 142
     int i, ret = 0;
143 143
     uint8_t *src2 = av_malloc((unsigned)size +
144
-                              FF_INPUT_BUFFER_PADDING_SIZE);
144
+                              AV_INPUT_BUFFER_PADDING_SIZE);
145 145
 
146 146
     if (!src2) {
147 147
         av_log(s->avctx, AV_LOG_ERROR,
... ...
@@ -159,7 +159,7 @@ static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,
159 159
         for (i = 0; i < size; i++)
160 160
             src2[i] = ff_reverse[src[i]];
161 161
     }
162
-    memset(src2 + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
162
+    memset(src2 + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
163 163
     ret = ff_ccitt_unpack(s->avctx, src2, size, dst, lines, stride,
164 164
                           s->compr, s->fax_opts);
165 165
     av_free(src2);
... ...
@@ -309,7 +309,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
309 309
     strips = (s->height - 1) / s->rps + 1;
310 310
 
311 311
     packet_size = avctx->height * ((avctx->width * s->bpp + 7) >> 3) * 2 +
312
-                  avctx->height * 4 + FF_MIN_BUFFER_SIZE;
312
+                  avctx->height * 4 + AV_INPUT_BUFFER_MIN_SIZE;
313 313
 
314 314
     if (!pkt->data &&
315 315
         (ret = av_new_packet(pkt, packet_size)) < 0) {
... ...
@@ -856,7 +856,7 @@ static int decode_frame(AVCodecContext *avctx,
856 856
     int i, t, ret;
857 857
     uint8_t *swbuf;
858 858
 
859
-    swbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
859
+    swbuf = av_malloc(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
860 860
     if (!swbuf) {
861 861
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
862 862
         return AVERROR(ENOMEM);
... ...
@@ -59,14 +59,14 @@ static void *avformat_mutex;
59 59
 void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
60 60
 {
61 61
     void **p = ptr;
62
-    if (min_size > SIZE_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
62
+    if (min_size > SIZE_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
63 63
         av_freep(p);
64 64
         *size = 0;
65 65
         return;
66 66
     }
67
-    av_fast_malloc(p, size, min_size + FF_INPUT_BUFFER_PADDING_SIZE);
67
+    av_fast_malloc(p, size, min_size + AV_INPUT_BUFFER_PADDING_SIZE);
68 68
     if (*size)
69
-        memset((uint8_t *)*p + min_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
69
+        memset((uint8_t *)*p + min_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
70 70
 }
71 71
 
72 72
 /* encoder management */
... ...
@@ -1324,7 +1324,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
1324 1324
 
1325 1325
 int ff_alloc_packet(AVPacket *avpkt, int size)
1326 1326
 {
1327
-    if (size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
1327
+    if (size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
1328 1328
         return AVERROR(EINVAL);
1329 1329
 
1330 1330
     if (avpkt->data) {
... ...
@@ -142,7 +142,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
142 142
 
143 143
         memcpy(c->slice_bits, src + slice_data_start + c->slices * 4,
144 144
                slice_size);
145
-        memset(c->slice_bits + slice_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
145
+        memset(c->slice_bits + slice_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
146 146
         c->bdsp.bswap_buf((uint32_t *) c->slice_bits,
147 147
                           (uint32_t *) c->slice_bits,
148 148
                           (slice_data_end - slice_data_start + 3) >> 2);
... ...
@@ -388,7 +388,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
388 388
     }
389 389
 
390 390
     av_fast_malloc(&c->slice_bits, &c->slice_bits_size,
391
-                   max_slice_size + FF_INPUT_BUFFER_PADDING_SIZE);
391
+                   max_slice_size + AV_INPUT_BUFFER_PADDING_SIZE);
392 392
 
393 393
     if (!c->slice_bits) {
394 394
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
... ...
@@ -157,7 +157,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
157 157
     avctx->extradata_size = 16;
158 158
 
159 159
     avctx->extradata = av_mallocz(avctx->extradata_size +
160
-                                  FF_INPUT_BUFFER_PADDING_SIZE);
160
+                                  AV_INPUT_BUFFER_PADDING_SIZE);
161 161
 
162 162
     if (!avctx->extradata) {
163 163
         av_log(avctx, AV_LOG_ERROR, "Could not allocate extradata.\n");
... ...
@@ -167,7 +167,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
167 167
 
168 168
     for (i = 0; i < c->planes; i++) {
169 169
         c->slice_buffer[i] = av_malloc(c->slice_stride * (avctx->height + 2) +
170
-                                       FF_INPUT_BUFFER_PADDING_SIZE);
170
+                                       AV_INPUT_BUFFER_PADDING_SIZE);
171 171
         if (!c->slice_buffer[i]) {
172 172
             av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 1.\n");
173 173
             utvideo_encode_close(avctx);
... ...
@@ -547,7 +547,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
547 547
     bytestream2_init_writer(&pb, dst, pkt->size);
548 548
 
549 549
     av_fast_malloc(&c->slice_bits, &c->slice_bits_size,
550
-                   width * height + FF_INPUT_BUFFER_PADDING_SIZE);
550
+                   width * height + AV_INPUT_BUFFER_PADDING_SIZE);
551 551
 
552 552
     if (!c->slice_bits) {
553 553
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 2.\n");
... ...
@@ -461,7 +461,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
461 461
             return -1;
462 462
         }
463 463
 
464
-        buf2  = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
464
+        buf2  = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
465 465
         start = find_next_marker(start, end); // in WVC1 extradata first byte is its size, but can be 0 in mkv
466 466
         next  = start;
467 467
         for (; next < end; start = next) {
... ...
@@ -612,7 +612,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
612 612
     //for advanced profile we may need to parse and unescape data
613 613
     if (avctx->codec_id == AV_CODEC_ID_VC1 || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
614 614
         int buf_size2 = 0;
615
-        buf2 = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
615
+        buf2 = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
616 616
 
617 617
         if (IS_MARKER(AV_RB32(buf))) { /* frame starts with marker and needs to be parsed */
618 618
             const uint8_t *start, *end, *next;
... ...
@@ -635,7 +635,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
635 635
                     if (!tmp)
636 636
                         goto err;
637 637
                     slices = tmp;
638
-                    slices[n_slices].buf = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
638
+                    slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
639 639
                     if (!slices[n_slices].buf)
640 640
                         goto err;
641 641
                     buf_size3 = vc1_unescape_buffer(start + 4, size,
... ...
@@ -660,7 +660,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
660 660
                     if (!tmp)
661 661
                         goto err;
662 662
                     slices = tmp;
663
-                    slices[n_slices].buf = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
663
+                    slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
664 664
                     if (!slices[n_slices].buf)
665 665
                         goto err;
666 666
                     buf_size3 = vc1_unescape_buffer(start + 4, size,
... ...
@@ -686,7 +686,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
686 686
                 if (!tmp)
687 687
                     goto err;
688 688
                 slices = tmp;
689
-                slices[n_slices].buf = av_mallocz(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
689
+                slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
690 690
                 if (!slices[n_slices].buf)
691 691
                     goto err;
692 692
                 buf_size3 = vc1_unescape_buffer(divider + 4, buf + buf_size - divider - 4, slices[n_slices].buf);
... ...
@@ -446,7 +446,7 @@ static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S)
446 446
         const int max_bits  = 1 + 23 + 8 + 1;
447 447
         const int left_bits = get_bits_left(&s->gb_extra_bits);
448 448
 
449
-        if (left_bits + 8 * FF_INPUT_BUFFER_PADDING_SIZE < max_bits)
449
+        if (left_bits + 8 * AV_INPUT_BUFFER_PADDING_SIZE < max_bits)
450 450
             return 0.0;
451 451
     }
452 452
 
... ...
@@ -120,7 +120,7 @@ typedef struct WMACodecContext {
120 120
     /* output buffer for one frame and the last for IMDCT windowing */
121 121
     DECLARE_ALIGNED(32, float, frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE * 2];
122 122
     /* last frame info */
123
-    uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; /* padding added */
123
+    uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; /* padding added */
124 124
     int last_bitoffset;
125 125
     int last_superframe_len;
126 126
     float noise_table[NOISE_TAB_SIZE];
... ...
@@ -853,7 +853,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
853 853
             }
854 854
             if (len > 0)
855 855
                 *q++ = (get_bits) (&s->gb, len) << (8 - len);
856
-            memset(q, 0, FF_INPUT_BUFFER_PADDING_SIZE);
856
+            memset(q, 0, AV_INPUT_BUFFER_PADDING_SIZE);
857 857
 
858 858
             /* XXX: bit_offset bits into last frame */
859 859
             init_get_bits(&s->gb, s->last_superframe,
... ...
@@ -69,7 +69,7 @@ typedef struct WmallDecodeCtx {
69 69
     /* generic decoder variables */
70 70
     AVCodecContext  *avctx;
71 71
     AVFrame         *frame;
72
-    uint8_t         frame_data[MAX_FRAMESIZE + FF_INPUT_BUFFER_PADDING_SIZE];  ///< compressed frame data
72
+    uint8_t         frame_data[MAX_FRAMESIZE + AV_INPUT_BUFFER_PADDING_SIZE];  ///< compressed frame data
73 73
     PutBitContext   pb;                             ///< context for filling the frame_data buffer
74 74
 
75 75
     /* frame size dependent frame information (set during initialization) */
... ...
@@ -173,7 +173,7 @@ typedef struct WMAProDecodeCtx {
173 173
     AVCodecContext*  avctx;                         ///< codec context for av_log
174 174
     AVFloatDSPContext fdsp;
175 175
     uint8_t          frame_data[MAX_FRAMESIZE +
176
-                      FF_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data
176
+                      AV_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data
177 177
     PutBitContext    pb;                            ///< context for filling the frame_data buffer
178 178
     FFTContext       mdct_ctx[WMAPRO_BLOCK_SIZES];  ///< MDCT context per block size
179 179
     DECLARE_ALIGNED(32, float, tmp)[WMAPRO_BLOCK_MAX_SIZE]; ///< IMDCT output buffer
... ...
@@ -205,7 +205,7 @@ typedef struct WMAVoiceContext {
205 205
                                   ///< to #wmavoice_decode_packet() (since
206 206
                                   ///< they're part of the previous superframe)
207 207
 
208
-    uint8_t sframe_cache[SFRAME_CACHE_MAXSIZE + FF_INPUT_BUFFER_PADDING_SIZE];
208
+    uint8_t sframe_cache[SFRAME_CACHE_MAXSIZE + AV_INPUT_BUFFER_PADDING_SIZE];
209 209
                                   ///< cache for superframe data split over
210 210
                                   ///< multiple packets
211 211
     int sframe_cache_size;        ///< set to >0 if we have data from an
... ...
@@ -75,7 +75,7 @@ static int decode_frame(AVCodecContext *avctx,
75 75
         return AVERROR_INVALIDDATA;
76 76
     }
77 77
 
78
-    rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
78
+    rbuf = av_malloc(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
79 79
     if (!rbuf) {
80 80
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
81 81
         return AVERROR(ENOMEM);
... ...
@@ -392,7 +392,7 @@ static int vfw_read_header(AVFormatContext *s)
392 392
         codec->codec_id = AV_CODEC_ID_RAWVIDEO;
393 393
         if(biCompression == BI_RGB) {
394 394
             codec->bits_per_coded_sample = biBitCount;
395
-            codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE);
395
+            codec->extradata = av_malloc(9 + AV_INPUT_BUFFER_PADDING_SIZE);
396 396
             if (codec->extradata) {
397 397
                 codec->extradata_size = 9;
398 398
                 memcpy(codec->extradata, "BottomUp", 9);
... ...
@@ -227,7 +227,7 @@ static int xcbgrab_frame_shm(AVFormatContext *s, AVPacket *pkt)
227 227
     xcb_shm_get_image_reply_t *img;
228 228
     xcb_drawable_t drawable = c->screen->root;
229 229
     uint8_t *data;
230
-    int size = c->frame_size + FF_INPUT_BUFFER_PADDING_SIZE;
230
+    int size = c->frame_size + AV_INPUT_BUFFER_PADDING_SIZE;
231 231
     int id   = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777);
232 232
     xcb_generic_error_t *e = NULL;
233 233
 
... ...
@@ -111,7 +111,7 @@ static int parse_vtrk(AVFormatContext *s,
111 111
     st->codec->codec_type     = AVMEDIA_TYPE_VIDEO;
112 112
     st->codec->codec_id       = AV_CODEC_ID_4XM;
113 113
 
114
-    st->codec->extradata      = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
114
+    st->codec->extradata      = av_mallocz(4 + AV_INPUT_BUFFER_PADDING_SIZE);
115 115
     if (!st->codec->extradata)
116 116
         return AVERROR(ENOMEM);
117 117
     st->codec->extradata_size = 4;
... ...
@@ -76,7 +76,7 @@ static int adx_read_header(AVFormatContext *s)
76 76
     c->header_size = avio_rb16(s->pb) + 4;
77 77
     avio_seek(s->pb, -4, SEEK_CUR);
78 78
 
79
-    avctx->extradata = av_mallocz(c->header_size + FF_INPUT_BUFFER_PADDING_SIZE);
79
+    avctx->extradata = av_mallocz(c->header_size + AV_INPUT_BUFFER_PADDING_SIZE);
80 80
     if (!avctx->extradata)
81 81
         return AVERROR(ENOMEM);
82 82
     if (avio_read(s->pb, avctx->extradata, c->header_size) < c->header_size) {
... ...
@@ -259,7 +259,7 @@ static int aiff_read_header(AVFormatContext *s)
259 259
         case MKTAG('w', 'a', 'v', 'e'):
260 260
             if ((uint64_t)size > (1<<30))
261 261
                 return -1;
262
-            st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
262
+            st->codec->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
263 263
             if (!st->codec->extradata)
264 264
                 return AVERROR(ENOMEM);
265 265
             st->codec->extradata_size = size;
... ...
@@ -133,7 +133,7 @@ static int read_header(AVFormatContext *s)
133 133
 
134 134
     /* color cycling and palette data */
135 135
     st->codec->extradata_size = 16*8 + 4*256;
136
-    st->codec->extradata      = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
136
+    st->codec->extradata      = av_mallocz(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
137 137
     if (!st->codec->extradata) {
138 138
         return AVERROR(ENOMEM);
139 139
     }
... ...
@@ -53,7 +53,7 @@ static int apc_read_header(AVFormatContext *s)
53 53
 
54 54
     st->codec->extradata_size = 2 * 4;
55 55
     st->codec->extradata = av_malloc(st->codec->extradata_size +
56
-                                     FF_INPUT_BUFFER_PADDING_SIZE);
56
+                                     AV_INPUT_BUFFER_PADDING_SIZE);
57 57
     if (!st->codec->extradata)
58 58
         return AVERROR(ENOMEM);
59 59
 
... ...
@@ -57,7 +57,7 @@ static int ape_tag_read_field(AVFormatContext *s)
57 57
         av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
58 58
         return -1;
59 59
     }
60
-    if (size > INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
60
+    if (size > INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
61 61
         av_log(s, AV_LOG_ERROR, "APE tag size too large.\n");
62 62
         return AVERROR_INVALIDDATA;
63 63
     }
... ...
@@ -94,7 +94,7 @@ static int ape_tag_read_field(AVFormatContext *s)
94 94
             st->attached_pic.stream_index = st->index;
95 95
             st->attached_pic.flags       |= AV_PKT_FLAG_KEY;
96 96
         } else {
97
-            st->codec->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
97
+            st->codec->extradata = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
98 98
             if (!st->codec->extradata)
99 99
                 return AVERROR(ENOMEM);
100 100
             if (avio_read(pb, st->codec->extradata, size) != size) {
... ...
@@ -674,12 +674,12 @@ static int parse_video_info(AVIOContext *pb, AVStream *st)
674 674
         int ret;
675 675
         st->codec->extradata_size  = size - BMP_HEADER_SIZE;
676 676
         if (!(st->codec->extradata = av_malloc(st->codec->extradata_size +
677
-                                               FF_INPUT_BUFFER_PADDING_SIZE))) {
677
+                                               AV_INPUT_BUFFER_PADDING_SIZE))) {
678 678
             st->codec->extradata_size = 0;
679 679
             return AVERROR(ENOMEM);
680 680
         }
681 681
         memset(st->codec->extradata + st->codec->extradata_size , 0,
682
-               FF_INPUT_BUFFER_PADDING_SIZE);
682
+               AV_INPUT_BUFFER_PADDING_SIZE);
683 683
         if ((ret = avio_read(pb, st->codec->extradata,
684 684
                              st->codec->extradata_size)) < 0)
685 685
             return ret;
... ...
@@ -625,7 +625,7 @@ static int avi_read_header(AVFormatContext *s)
625 625
                     if (size > 10 * 4 && size < (1 << 30)) {
626 626
                         st->codec->extradata_size = size - 10 * 4;
627 627
                         st->codec->extradata      = av_malloc(st->codec->extradata_size +
628
-                                                              FF_INPUT_BUFFER_PADDING_SIZE);
628
+                                                              AV_INPUT_BUFFER_PADDING_SIZE);
629 629
                         if (!st->codec->extradata) {
630 630
                             st->codec->extradata_size = 0;
631 631
                             return AVERROR(ENOMEM);
... ...
@@ -696,7 +696,7 @@ static int avi_read_header(AVFormatContext *s)
696 696
                         st->codec->extradata_size += 9;
697 697
                         if ((ret = av_reallocp(&st->codec->extradata,
698 698
                                                st->codec->extradata_size +
699
-                                               FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
699
+                                               AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
700 700
                             st->codec->extradata_size = 0;
701 701
                             return ret;
702 702
                         } else
... ...
@@ -396,7 +396,7 @@ int avio_open_dyn_buf(AVIOContext **s);
396 396
 /**
397 397
  * Return the written size and a pointer to the buffer. The buffer
398 398
  * must be freed with av_free().
399
- * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
399
+ * Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
400 400
  *
401 401
  * @param s IO context
402 402
  * @param pbuffer pointer to a byte buffer
... ...
@@ -983,7 +983,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
983 983
 {
984 984
     DynBuffer *d;
985 985
     int size;
986
-    static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0};
986
+    static const char padbuf[AV_INPUT_BUFFER_PADDING_SIZE] = {0};
987 987
     int padding = 0;
988 988
 
989 989
     if (!s) {
... ...
@@ -994,7 +994,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
994 994
     /* don't attempt to pad fixed-size packet buffers */
995 995
     if (!s->max_packet_size) {
996 996
         avio_write(s, padbuf, sizeof(padbuf));
997
-        padding = FF_INPUT_BUFFER_PADDING_SIZE;
997
+        padding = AV_INPUT_BUFFER_PADDING_SIZE;
998 998
     }
999 999
 
1000 1000
     avio_flush(s);
... ...
@@ -120,7 +120,7 @@ static int read_header(AVFormatContext *s)
120 120
 
121 121
     vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
122 122
     vst->codec->codec_id   = AV_CODEC_ID_BINKVIDEO;
123
-    vst->codec->extradata  = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
123
+    vst->codec->extradata  = av_mallocz(4 + AV_INPUT_BUFFER_PADDING_SIZE);
124 124
     if (!vst->codec->extradata)
125 125
         return AVERROR(ENOMEM);
126 126
     vst->codec->extradata_size = 4;
... ...
@@ -156,7 +156,7 @@ static int read_header(AVFormatContext *s)
156 156
                 ast->codec->channels       = 1;
157 157
                 ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
158 158
             }
159
-            ast->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
159
+            ast->codec->extradata = av_mallocz(4 + AV_INPUT_BUFFER_PADDING_SIZE);
160 160
             if (!ast->codec->extradata)
161 161
                 return AVERROR(ENOMEM);
162 162
             ast->codec->extradata_size = 4;
... ...
@@ -101,7 +101,7 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size)
101 101
     AVIOContext *pb = s->pb;
102 102
     AVStream *st      = s->streams[0];
103 103
 
104
-    if (size < 0 || size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
104
+    if (size < 0 || size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
105 105
         return -1;
106 106
 
107 107
     if (st->codec->codec_id == AV_CODEC_ID_AAC) {
... ...
@@ -131,7 +131,7 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size)
131 131
         }
132 132
         avio_read(pb, preamble, ALAC_PREAMBLE);
133 133
 
134
-        st->codec->extradata = av_mallocz(ALAC_HEADER + FF_INPUT_BUFFER_PADDING_SIZE);
134
+        st->codec->extradata = av_mallocz(ALAC_HEADER + AV_INPUT_BUFFER_PADDING_SIZE);
135 135
         if (!st->codec->extradata)
136 136
             return AVERROR(ENOMEM);
137 137
 
... ...
@@ -157,7 +157,7 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size)
157 157
         }
158 158
         st->codec->extradata_size = ALAC_HEADER;
159 159
     } else {
160
-        st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
160
+        st->codec->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
161 161
         if (!st->codec->extradata)
162 162
             return AVERROR(ENOMEM);
163 163
         avio_read(pb, st->codec->extradata, size);
... ...
@@ -58,7 +58,7 @@ static int flac_read_header(AVFormatContext *s)
58 58
         case FLAC_METADATA_TYPE_CUESHEET:
59 59
         case FLAC_METADATA_TYPE_PICTURE:
60 60
         case FLAC_METADATA_TYPE_VORBIS_COMMENT:
61
-            buffer = av_mallocz(metadata_size + FF_INPUT_BUFFER_PADDING_SIZE);
61
+            buffer = av_mallocz(metadata_size + AV_INPUT_BUFFER_PADDING_SIZE);
62 62
             if (!buffer) {
63 63
                 return AVERROR(ENOMEM);
64 64
             }
... ...
@@ -592,7 +592,7 @@ static int flv_read_close(AVFormatContext *s)
592 592
 static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
593 593
 {
594 594
     av_free(st->codec->extradata);
595
-    st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
595
+    st->codec->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
596 596
     if (!st->codec->extradata)
597 597
         return AVERROR(ENOMEM);
598 598
     st->codec->extradata_size = size;
... ...
@@ -605,7 +605,7 @@ static int flv_queue_extradata(FLVContext *flv, AVIOContext *pb, int stream,
605 605
 {
606 606
     av_free(flv->new_extradata[stream]);
607 607
     flv->new_extradata[stream] = av_mallocz(size +
608
-                                            FF_INPUT_BUFFER_PADDING_SIZE);
608
+                                            AV_INPUT_BUFFER_PADDING_SIZE);
609 609
     if (!flv->new_extradata[stream])
610 610
         return AVERROR(ENOMEM);
611 611
     flv->new_extradata_size[stream] = size;
... ...
@@ -636,7 +636,7 @@ static uint8_t *nal_unit_extract_rbsp(const uint8_t *src, uint32_t src_len,
636 636
     uint8_t *dst;
637 637
     uint32_t i, len;
638 638
 
639
-    dst = av_malloc(src_len + FF_INPUT_BUFFER_PADDING_SIZE);
639
+    dst = av_malloc(src_len + AV_INPUT_BUFFER_PADDING_SIZE);
640 640
     if (!dst)
641 641
         return NULL;
642 642
 
... ...
@@ -495,10 +495,10 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
495 495
         goto fail;
496 496
     }
497 497
 
498
-    apic->buf = av_buffer_alloc(taglen + FF_INPUT_BUFFER_PADDING_SIZE);
498
+    apic->buf = av_buffer_alloc(taglen + AV_INPUT_BUFFER_PADDING_SIZE);
499 499
     if (!apic->buf || avio_read(pb, apic->buf->data, taglen) != taglen)
500 500
         goto fail;
501
-    memset(apic->buf->data + taglen, 0, FF_INPUT_BUFFER_PADDING_SIZE);
501
+    memset(apic->buf->data + taglen, 0, AV_INPUT_BUFFER_PADDING_SIZE);
502 502
 
503 503
     new_extra->tag  = "APIC";
504 504
     new_extra->data = apic;
... ...
@@ -772,7 +772,7 @@ int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
772 772
         av_init_packet(&st->attached_pic);
773 773
         st->attached_pic.buf          = apic->buf;
774 774
         st->attached_pic.data         = apic->buf->data;
775
-        st->attached_pic.size         = apic->buf->size - FF_INPUT_BUFFER_PADDING_SIZE;
775
+        st->attached_pic.size         = apic->buf->size - AV_INPUT_BUFFER_PADDING_SIZE;
776 776
         st->attached_pic.stream_index = st->index;
777 777
         st->attached_pic.flags       |= AV_PKT_FLAG_KEY;
778 778
 
... ...
@@ -454,7 +454,7 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext
454 454
         if (!len || (uint64_t)len > (1<<30))
455 455
             return -1;
456 456
         av_free(st->codec->extradata);
457
-        st->codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
457
+        st->codec->extradata = av_mallocz(len + AV_INPUT_BUFFER_PADDING_SIZE);
458 458
         if (!st->codec->extradata)
459 459
             return AVERROR(ENOMEM);
460 460
         avio_read(pb, st->codec->extradata, len);
... ...
@@ -196,7 +196,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
196 196
                     return ret;
197 197
                 if (ret < size) {
198 198
                     memset(pkt->data + JV_PREAMBLE_SIZE + ret, 0,
199
-                           FF_INPUT_BUFFER_PADDING_SIZE);
199
+                           AV_INPUT_BUFFER_PADDING_SIZE);
200 200
                     pkt->flags |= AV_PKT_FLAG_CORRUPT;
201 201
                 }
202 202
                 pkt->size         = ret + JV_PREAMBLE_SIZE;
... ...
@@ -747,7 +747,7 @@ static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
747 747
 static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)
748 748
 {
749 749
     av_free(bin->data);
750
-    if (!(bin->data = av_mallocz(length + FF_INPUT_BUFFER_PADDING_SIZE)))
750
+    if (!(bin->data = av_mallocz(length + AV_INPUT_BUFFER_PADDING_SIZE)))
751 751
         return AVERROR(ENOMEM);
752 752
 
753 753
     bin->size = length;
... ...
@@ -1205,7 +1205,7 @@ static void matroska_fix_ass_packet(MatroskaDemuxContext *matroska,
1205 1205
         es     = ec / 100;
1206 1206
         ec    -= 100 * es;
1207 1207
         *ptr++ = '\0';
1208
-        len    = 50 + end - ptr + FF_INPUT_BUFFER_PADDING_SIZE;
1208
+        len    = 50 + end - ptr + AV_INPUT_BUFFER_PADDING_SIZE;
1209 1209
         if (!(line = av_buffer_alloc(len)))
1210 1210
             return;
1211 1211
         snprintf(line->data, len,
... ...
@@ -1644,7 +1644,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
1644 1644
         } else if (codec_id == AV_CODEC_ID_AAC && !track->codec_priv.size) {
1645 1645
             int profile = matroska_aac_profile(track->codec_id);
1646 1646
             int sri     = matroska_aac_sri(track->audio.samplerate);
1647
-            extradata   = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
1647
+            extradata   = av_mallocz(5 + AV_INPUT_BUFFER_PADDING_SIZE);
1648 1648
             if (!extradata)
1649 1649
                 return AVERROR(ENOMEM);
1650 1650
             extradata[0] = (profile << 3) | ((sri & 0x0E) >> 1);
... ...
@@ -1663,7 +1663,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
1663 1663
              * decoder expects manually. */
1664 1664
             extradata_size = 12 + track->codec_priv.size;
1665 1665
             extradata      = av_mallocz(extradata_size +
1666
-                                        FF_INPUT_BUFFER_PADDING_SIZE);
1666
+                                        AV_INPUT_BUFFER_PADDING_SIZE);
1667 1667
             if (!extradata)
1668 1668
                 return AVERROR(ENOMEM);
1669 1669
             AV_WB32(extradata, extradata_size);
... ...
@@ -1768,7 +1768,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
1768 1768
                 st->codec->extradata_size = extradata_size;
1769 1769
             } else if (track->codec_priv.data && track->codec_priv.size > 0) {
1770 1770
                 st->codec->extradata = av_mallocz(track->codec_priv.size +
1771
-                                                  FF_INPUT_BUFFER_PADDING_SIZE);
1771
+                                                  AV_INPUT_BUFFER_PADDING_SIZE);
1772 1772
                 if (!st->codec->extradata)
1773 1773
                     return AVERROR(ENOMEM);
1774 1774
                 st->codec->extradata_size = track->codec_priv.size;
... ...
@@ -963,7 +963,7 @@ static int mov_read_smi(MOVContext *c, AVIOContext *pb, MOVAtom atom)
963 963
     // currently SVQ3 decoder expect full STSD header - so let's fake it
964 964
     // this should be fixed and just SMI header should be passed
965 965
     av_free(st->codec->extradata);
966
-    st->codec->extradata = av_mallocz(atom.size + 0x5a + FF_INPUT_BUFFER_PADDING_SIZE);
966
+    st->codec->extradata = av_mallocz(atom.size + 0x5a + AV_INPUT_BUFFER_PADDING_SIZE);
967 967
     if (!st->codec->extradata)
968 968
         return AVERROR(ENOMEM);
969 969
     st->codec->extradata_size = 0x5a + atom.size;
... ...
@@ -1127,7 +1127,7 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom)
1127 1127
     if (c->fc->nb_streams < 1) // will happen with jp2 files
1128 1128
         return 0;
1129 1129
     st= c->fc->streams[c->fc->nb_streams-1];
1130
-    size= (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE;
1130
+    size= (uint64_t)st->codec->extradata_size + atom.size + 8 + AV_INPUT_BUFFER_PADDING_SIZE;
1131 1131
     if (size > INT_MAX || (uint64_t)atom.size > INT_MAX)
1132 1132
         return AVERROR_INVALIDDATA;
1133 1133
     if ((err = av_reallocp(&st->codec->extradata, size)) < 0) {
... ...
@@ -1135,7 +1135,7 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom)
1135 1135
         return err;
1136 1136
     }
1137 1137
     buf = st->codec->extradata + st->codec->extradata_size;
1138
-    st->codec->extradata_size= size - FF_INPUT_BUFFER_PADDING_SIZE;
1138
+    st->codec->extradata_size= size - AV_INPUT_BUFFER_PADDING_SIZE;
1139 1139
     AV_WB32(       buf    , atom.size + 8);
1140 1140
     AV_WL32(       buf + 4, atom.type);
1141 1141
 
... ...
@@ -1161,7 +1161,7 @@ static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
1161 1161
     if (st->codec->codec_id == AV_CODEC_ID_QDM2 || st->codec->codec_id == AV_CODEC_ID_QDMC) {
1162 1162
         // pass all frma atom to codec, needed at least for QDMC and QDM2
1163 1163
         av_free(st->codec->extradata);
1164
-        st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE);
1164
+        st->codec->extradata = av_mallocz(atom.size + AV_INPUT_BUFFER_PADDING_SIZE);
1165 1165
         if (!st->codec->extradata)
1166 1166
             return AVERROR(ENOMEM);
1167 1167
         st->codec->extradata_size = atom.size;
... ...
@@ -1203,7 +1203,7 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
1203 1203
             return mov_read_default(c, pb, atom);
1204 1204
     }
1205 1205
     av_free(st->codec->extradata);
1206
-    st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE);
1206
+    st->codec->extradata = av_mallocz(atom.size + AV_INPUT_BUFFER_PADDING_SIZE);
1207 1207
     if (!st->codec->extradata)
1208 1208
         return AVERROR(ENOMEM);
1209 1209
     st->codec->extradata_size = atom.size;
... ...
@@ -1233,7 +1233,7 @@ static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
1233 1233
         return 0;
1234 1234
 
1235 1235
     av_free(st->codec->extradata);
1236
-    st->codec->extradata = av_mallocz(atom.size - 7 + FF_INPUT_BUFFER_PADDING_SIZE);
1236
+    st->codec->extradata = av_mallocz(atom.size - 7 + AV_INPUT_BUFFER_PADDING_SIZE);
1237 1237
     if (!st->codec->extradata)
1238 1238
         return AVERROR(ENOMEM);
1239 1239
     st->codec->extradata_size = atom.size - 7;
... ...
@@ -1266,7 +1266,7 @@ static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom)
1266 1266
         return AVERROR_INVALIDDATA;
1267 1267
 
1268 1268
     av_free(st->codec->extradata);
1269
-    st->codec->extradata = av_mallocz(atom.size - 40 + FF_INPUT_BUFFER_PADDING_SIZE);
1269
+    st->codec->extradata = av_mallocz(atom.size - 40 + AV_INPUT_BUFFER_PADDING_SIZE);
1270 1270
     if (!st->codec->extradata)
1271 1271
         return AVERROR(ENOMEM);
1272 1272
     st->codec->extradata_size = atom.size - 40;
... ...
@@ -1629,7 +1629,7 @@ static int mov_rewrite_dvd_sub_extradata(AVStream *st)
1629 1629
 
1630 1630
     av_freep(&st->codec->extradata);
1631 1631
     st->codec->extradata_size = 0;
1632
-    st->codec->extradata = av_mallocz(strlen(buf) + FF_INPUT_BUFFER_PADDING_SIZE);
1632
+    st->codec->extradata = av_mallocz(strlen(buf) + AV_INPUT_BUFFER_PADDING_SIZE);
1633 1633
     if (!st->codec->extradata)
1634 1634
         return AVERROR(ENOMEM);
1635 1635
     st->codec->extradata_size = strlen(buf);
... ...
@@ -1646,7 +1646,7 @@ static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
1646 1646
 
1647 1647
     if (st->codec->codec_tag == MKTAG('t','m','c','d')) {
1648 1648
         st->codec->extradata_size = size;
1649
-        st->codec->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
1649
+        st->codec->extradata = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
1650 1650
         if (!st->codec->extradata)
1651 1651
             return AVERROR(ENOMEM);
1652 1652
         ret = ffio_read_size(pb, st->codec->extradata, size);
... ...
@@ -2003,7 +2003,7 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
2003 2003
 
2004 2004
     num_bytes = (entries*field_size+4)>>3;
2005 2005
 
2006
-    buf = av_malloc(num_bytes+FF_INPUT_BUFFER_PADDING_SIZE);
2006
+    buf = av_malloc(num_bytes+AV_INPUT_BUFFER_PADDING_SIZE);
2007 2007
     if (!buf) {
2008 2008
         av_freep(&sc->sample_sizes);
2009 2009
         return AVERROR(ENOMEM);
... ...
@@ -455,7 +455,7 @@ static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf)
455 455
                "dvc1 atom. Set the delay_moov flag to fix this.\n");
456 456
     }
457 457
 
458
-    unescaped = av_mallocz(track->vos_len + FF_INPUT_BUFFER_PADDING_SIZE);
458
+    unescaped = av_mallocz(track->vos_len + AV_INPUT_BUFFER_PADDING_SIZE);
459 459
     if (!unescaped)
460 460
         return AVERROR(ENOMEM);
461 461
     start = find_next_marker(track->vos_data, end);
... ...
@@ -96,7 +96,7 @@ static int mpc_read_header(AVFormatContext *s)
96 96
     st->codec->bits_per_coded_sample = 16;
97 97
 
98 98
     st->codec->extradata_size = 16;
99
-    st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
99
+    st->codec->extradata = av_mallocz(st->codec->extradata_size+AV_INPUT_BUFFER_PADDING_SIZE);
100 100
     avio_read(s->pb, st->codec->extradata, 16);
101 101
     st->codec->sample_rate = mpc_rate[st->codec->extradata[2] & 3];
102 102
     avpriv_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate);
... ...
@@ -154,7 +154,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
154 154
         av_log(s, AV_LOG_ERROR, "Bad seek table size\n");
155 155
         return;
156 156
     }
157
-    if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
157
+    if(!(buf = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE)))
158 158
         return;
159 159
     avio_read(s->pb, buf, size);
160 160
     init_get_bits(&gb, buf, size * 8);
... ...
@@ -242,7 +242,7 @@ static int mpc8_read_header(AVFormatContext *s)
242 242
     st->codec->bits_per_coded_sample = 16;
243 243
 
244 244
     st->codec->extradata_size = 2;
245
-    st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
245
+    st->codec->extradata = av_mallocz(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
246 246
     avio_read(pb, st->codec->extradata, st->codec->extradata_size);
247 247
 
248 248
     st->codec->channels = (st->codec->extradata[1] >> 4) + 1;
... ...
@@ -711,7 +711,7 @@ static void new_pes_packet(PESContext *pes, AVPacket *pkt)
711 711
         av_log(pes->stream, AV_LOG_WARNING, "PES packet size mismatch\n");
712 712
         pes->flags |= AV_PKT_FLAG_CORRUPT;
713 713
     }
714
-    memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
714
+    memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
715 715
 
716 716
     // Separate out the AC3 substream from an HDMV combined TrueHD/AC3 PID
717 717
     if (pes->sub_st && pes->stream_type == 0x83 && pes->extended_stream_id == 0x76)
... ...
@@ -864,7 +864,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
864 864
 
865 865
                     /* allocate pes buffer */
866 866
                     pes->buffer = av_buffer_alloc(pes->total_size +
867
-                                                  FF_INPUT_BUFFER_PADDING_SIZE);
867
+                                                  AV_INPUT_BUFFER_PADDING_SIZE);
868 868
                     if (!pes->buffer)
869 869
                         return AVERROR(ENOMEM);
870 870
 
... ...
@@ -971,7 +971,7 @@ skip:
971 971
                     new_pes_packet(pes, ts->pkt);
972 972
                     pes->total_size = MAX_PES_PAYLOAD;
973 973
                     pes->buffer = av_buffer_alloc(pes->total_size +
974
-                                                  FF_INPUT_BUFFER_PADDING_SIZE);
974
+                                                  AV_INPUT_BUFFER_PADDING_SIZE);
975 975
                     if (!pes->buffer)
976 976
                         return AVERROR(ENOMEM);
977 977
                     ts->stop_parse = 1;
... ...
@@ -1436,7 +1436,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
1436 1436
                 memcmp(st->codec->extradata, *pp, 4))
1437 1437
                 avpriv_request_sample(fc, "DVB sub with multiple IDs");
1438 1438
         } else {
1439
-            st->codec->extradata = av_malloc(4 + FF_INPUT_BUFFER_PADDING_SIZE);
1439
+            st->codec->extradata = av_malloc(4 + AV_INPUT_BUFFER_PADDING_SIZE);
1440 1440
             if (st->codec->extradata) {
1441 1441
                 st->codec->extradata_size = 4;
1442 1442
                 memcpy(st->codec->extradata, *pp, 4);
... ...
@@ -1482,7 +1482,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
1482 1482
             ext_desc_tag == 0x80) { /* User defined (provisional Opus) */
1483 1483
             if (!st->codec->extradata) {
1484 1484
                 st->codec->extradata = av_mallocz(sizeof(opus_default_extradata) +
1485
-                                                  FF_INPUT_BUFFER_PADDING_SIZE);
1485
+                                                  AV_INPUT_BUFFER_PADDING_SIZE);
1486 1486
                 if (!st->codec->extradata)
1487 1487
                     return AVERROR(ENOMEM);
1488 1488
 
... ...
@@ -1956,7 +1956,7 @@ static void finished_reading_packet(AVFormatContext *s, int raw_packet_size)
1956 1956
 static int handle_packets(MpegTSContext *ts, int nb_packets)
1957 1957
 {
1958 1958
     AVFormatContext *s = ts->stream;
1959
-    uint8_t packet[TS_PACKET_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
1959
+    uint8_t packet[TS_PACKET_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
1960 1960
     const uint8_t *data;
1961 1961
     int packet_num, ret = 0;
1962 1962
 
... ...
@@ -1979,7 +1979,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
1979 1979
 
1980 1980
     ts->stop_parse = 0;
1981 1981
     packet_num = 0;
1982
-    memset(packet + TS_PACKET_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
1982
+    memset(packet + TS_PACKET_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
1983 1983
     for (;;) {
1984 1984
         if (ts->stop_parse > 0)
1985 1985
             break;
... ...
@@ -55,7 +55,7 @@ static int read_header(AVFormatContext *s)
55 55
         return AVERROR(ENOMEM);
56 56
 
57 57
     vst->codec->extradata_size = 2;
58
-    vst->codec->extradata = av_mallocz(2 + FF_INPUT_BUFFER_PADDING_SIZE);
58
+    vst->codec->extradata = av_mallocz(2 + AV_INPUT_BUFFER_PADDING_SIZE);
59 59
 
60 60
     version                  = avio_r8(pb);
61 61
     vst->codec->extradata[0] = avio_r8(pb);
... ...
@@ -895,7 +895,7 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int
895 895
         if (IS_KLV_KEY(uid, mxf_sony_mpeg4_extradata)) {
896 896
             av_free(descriptor->extradata);
897 897
             descriptor->extradata_size = 0;
898
-            descriptor->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
898
+            descriptor->extradata = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
899 899
             if (!descriptor->extradata)
900 900
                 return AVERROR(ENOMEM);
901 901
             descriptor->extradata_size = size;
... ...
@@ -1653,7 +1653,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
1653 1653
             }
1654 1654
         }
1655 1655
         if (descriptor->extradata) {
1656
-            st->codec->extradata = av_mallocz(descriptor->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
1656
+            st->codec->extradata = av_mallocz(descriptor->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
1657 1657
             if (st->codec->extradata) {
1658 1658
                 memcpy(st->codec->extradata, descriptor->extradata, descriptor->extradata_size);
1659 1659
                 st->codec->extradata_size = descriptor->extradata_size;
... ...
@@ -110,7 +110,7 @@ static int mxg_update_cache(AVFormatContext *s, unsigned int cache_size)
110 110
     if (mxg->soi_ptr) soi_pos = mxg->soi_ptr - mxg->buffer;
111 111
     mxg->buffer = av_fast_realloc(mxg->buffer, &mxg->buffer_size,
112 112
                                   current_pos + cache_size +
113
-                                  FF_INPUT_BUFFER_PADDING_SIZE);
113
+                                  AV_INPUT_BUFFER_PADDING_SIZE);
114 114
     if (!mxg->buffer)
115 115
         return AVERROR(ENOMEM);
116 116
     mxg->buffer_ptr = mxg->buffer + current_pos;
... ...
@@ -408,7 +408,7 @@ static int decode_stream_header(NUTContext *nut)
408 408
     GET_V(st->codec->extradata_size, tmp < (1 << 30));
409 409
     if (st->codec->extradata_size) {
410 410
         st->codec->extradata = av_mallocz(st->codec->extradata_size +
411
-                                          FF_INPUT_BUFFER_PADDING_SIZE);
411
+                                          AV_INPUT_BUFFER_PADDING_SIZE);
412 412
         if (!st->codec->extradata)
413 413
             return AVERROR(ENOMEM);
414 414
         avio_read(bc, st->codec->extradata, st->codec->extradata_size);
... ...
@@ -74,7 +74,7 @@ static int ogg_save(AVFormatContext *s)
74 74
 
75 75
     for (i = 0; i < ogg->nstreams; i++) {
76 76
         struct ogg_stream *os = ogg->streams + i;
77
-        os->buf = av_mallocz(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
77
+        os->buf = av_mallocz(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE);
78 78
         memcpy(os->buf, ost->streams[i].buf, os->bufpos);
79 79
     }
80 80
 
... ...
@@ -172,7 +172,7 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream)
172 172
     os                = ogg->streams + idx;
173 173
     os->serial        = serial;
174 174
     os->bufsize       = DECODER_BUFFER_SIZE;
175
-    os->buf           = av_malloc(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
175
+    os->buf           = av_malloc(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE);
176 176
     os->header        = -1;
177 177
     os->start_granule = OGG_NOGRANULE_VALUE;
178 178
 
... ...
@@ -191,7 +191,7 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream)
191 191
 static int ogg_new_buf(struct ogg *ogg, int idx)
192 192
 {
193 193
     struct ogg_stream *os = ogg->streams + idx;
194
-    uint8_t *nb = av_malloc(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
194
+    uint8_t *nb = av_malloc(os->bufsize + AV_INPUT_BUFFER_PADDING_SIZE);
195 195
     int size = os->bufpos - os->pstart;
196 196
 
197 197
     if (!nb)
... ...
@@ -315,7 +315,7 @@ static int ogg_read_page(AVFormatContext *s, int *str)
315 315
     }
316 316
 
317 317
     if (os->bufsize - os->bufpos < size) {
318
-        uint8_t *nb = av_malloc((os->bufsize *= 2) + FF_INPUT_BUFFER_PADDING_SIZE);
318
+        uint8_t *nb = av_malloc((os->bufsize *= 2) + AV_INPUT_BUFFER_PADDING_SIZE);
319 319
         if (!nb)
320 320
             return AVERROR(ENOMEM);
321 321
         memcpy(nb, os->buf, os->bufpos);
... ...
@@ -331,7 +331,7 @@ static int ogg_read_page(AVFormatContext *s, int *str)
331 331
     os->granule = gp;
332 332
     os->flags   = flags;
333 333
 
334
-    memset(os->buf + os->bufpos, 0, FF_INPUT_BUFFER_PADDING_SIZE);
334
+    memset(os->buf + os->bufpos, 0, AV_INPUT_BUFFER_PADDING_SIZE);
335 335
     if (str)
336 336
         *str = idx;
337 337
 
... ...
@@ -47,7 +47,7 @@ static int celt_header(AVFormatContext *s, int idx)
47 47
         uint8_t *extradata;
48 48
 
49 49
         extradata = av_malloc(2 * sizeof(uint32_t) +
50
-                              FF_INPUT_BUFFER_PADDING_SIZE);
50
+                              AV_INPUT_BUFFER_PADDING_SIZE);
51 51
         priv = av_malloc(sizeof(struct oggcelt_private));
52 52
         if (!extradata || !priv) {
53 53
             av_free(extradata);
... ...
@@ -62,7 +62,7 @@ flac_header (AVFormatContext * s, int idx)
62 62
         st->need_parsing = AVSTREAM_PARSE_HEADERS;
63 63
 
64 64
         st->codec->extradata =
65
-            av_malloc(FLAC_STREAMINFO_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
65
+            av_malloc(FLAC_STREAMINFO_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
66 66
         memcpy(st->codec->extradata, streaminfo_start, FLAC_STREAMINFO_SIZE);
67 67
         st->codec->extradata_size = FLAC_STREAMINFO_SIZE;
68 68
 
... ...
@@ -57,7 +57,7 @@ static int opus_header(AVFormatContext *avf, int idx)
57 57
         st->codec->channels   = AV_RL8(packet + 9);
58 58
         priv->pre_skip        = AV_RL16(packet + 10);
59 59
 
60
-        extradata = av_malloc(os->psize + FF_INPUT_BUFFER_PADDING_SIZE);
60
+        extradata = av_malloc(os->psize + AV_INPUT_BUFFER_PADDING_SIZE);
61 61
         if (!extradata)
62 62
             return AVERROR(ENOMEM);
63 63
 
... ...
@@ -74,7 +74,7 @@ static int speex_header(AVFormatContext *s, int idx) {
74 74
 
75 75
         st->codec->extradata_size = os->psize;
76 76
         st->codec->extradata = av_malloc(st->codec->extradata_size
77
-                                         + FF_INPUT_BUFFER_PADDING_SIZE);
77
+                                         + AV_INPUT_BUFFER_PADDING_SIZE);
78 78
         memcpy(st->codec->extradata, p, st->codec->extradata_size);
79 79
 
80 80
         avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
... ...
@@ -126,7 +126,7 @@ static int theora_header(AVFormatContext *s, int idx)
126 126
     }
127 127
 
128 128
     if ((err = av_reallocp(&st->codec->extradata,
129
-                           cds + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
129
+                           cds + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
130 130
         st->codec->extradata_size = 0;
131 131
         return err;
132 132
     }
... ...
@@ -234,7 +234,7 @@ static int fixup_vorbis_headers(AVFormatContext *as,
234 234
         offset += priv->len[i];
235 235
         av_freep(&priv->packet[i]);
236 236
     }
237
-    if ((err = av_reallocp(buf, offset + FF_INPUT_BUFFER_PADDING_SIZE)) < 0)
237
+    if ((err = av_reallocp(buf, offset + AV_INPUT_BUFFER_PADDING_SIZE)) < 0)
238 238
         return err;
239 239
     return offset;
240 240
 }
... ...
@@ -357,7 +357,7 @@ static int oma_read_header(AVFormatContext *s)
357 357
         /* fake the ATRAC3 extradata
358 358
          * (wav format, makes stream copy to wav work) */
359 359
         st->codec->extradata_size = 14;
360
-        edata = av_mallocz(14 + FF_INPUT_BUFFER_PADDING_SIZE);
360
+        edata = av_mallocz(14 + AV_INPUT_BUFFER_PADDING_SIZE);
361 361
         if (!edata)
362 362
             return AVERROR(ENOMEM);
363 363
 
... ...
@@ -49,7 +49,7 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
49 49
     } else if (ret < size) {
50 50
         /* initialize end of packet for partial reads to avoid reading
51 51
          * uninitialized data on allowed overreads */
52
-        memset(pkt->data + ret, 0, FF_INPUT_BUFFER_PADDING_SIZE);
52
+        memset(pkt->data + ret, 0, AV_INPUT_BUFFER_PADDING_SIZE);
53 53
     }
54 54
     pkt->size = ret;
55 55
     return ret;
... ...
@@ -86,7 +86,7 @@ struct PayloadContext {
86 86
     RMStream **rmst;
87 87
     uint8_t *mlti_data;
88 88
     unsigned int mlti_data_size;
89
-    char buffer[RTP_MAX_PACKET_LENGTH + FF_INPUT_BUFFER_PADDING_SIZE];
89
+    char buffer[RTP_MAX_PACKET_LENGTH + AV_INPUT_BUFFER_PADDING_SIZE];
90 90
     int audio_pkt_cnt; /**< remaining audio packets in rmdec */
91 91
 };
92 92
 
... ...
@@ -398,7 +398,7 @@ rdt_parse_b64buf (unsigned int *target_len, const char *p)
398 398
         len -= 2; /* skip embracing " at start/end */
399 399
     }
400 400
     *target_len = len * 3 / 4;
401
-    target = av_mallocz(*target_len + FF_INPUT_BUFFER_PADDING_SIZE);
401
+    target = av_mallocz(*target_len + AV_INPUT_BUFFER_PADDING_SIZE);
402 402
     if (!target)
403 403
         return NULL;
404 404
     av_base64_decode(target, p, *target_len);
... ...
@@ -114,7 +114,7 @@ int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb,
114 114
         if (cbSize > 0) {
115 115
             av_free(codec->extradata);
116 116
             codec->extradata = av_mallocz(codec->extradata_size +
117
-                                          FF_INPUT_BUFFER_PADDING_SIZE);
117
+                                          AV_INPUT_BUFFER_PADDING_SIZE);
118 118
             if (!codec->extradata)
119 119
                 return AVERROR(ENOMEM);
120 120
             avio_read(pb, codec->extradata, codec->extradata_size);
... ...
@@ -132,7 +132,7 @@ static av_cold int rl2_read_header(AVFormatContext *s)
132 132
         st->codec->extradata_size += back_size;
133 133
 
134 134
     st->codec->extradata = av_mallocz(st->codec->extradata_size +
135
-                                          FF_INPUT_BUFFER_PADDING_SIZE);
135
+                                          AV_INPUT_BUFFER_PADDING_SIZE);
136 136
     if(!st->codec->extradata)
137 137
         return AVERROR(ENOMEM);
138 138
 
... ...
@@ -86,7 +86,7 @@ static int rm_read_extradata(AVIOContext *pb, AVCodecContext *avctx, unsigned si
86 86
 {
87 87
     if (size >= 1<<24)
88 88
         return -1;
89
-    avctx->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
89
+    avctx->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
90 90
     if (!avctx->extradata)
91 91
         return AVERROR(ENOMEM);
92 92
     avctx->extradata_size = avio_read(pb, avctx->extradata, size);
... ...
@@ -203,7 +203,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
203 203
             if (version == 5)
204 204
                 avio_r8(pb);
205 205
             codecdata_length = avio_rb32(pb);
206
-            if(codecdata_length + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
206
+            if(codecdata_length + AV_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
207 207
                 av_log(s, AV_LOG_ERROR, "codecdata_length too large\n");
208 208
                 return -1;
209 209
             }
... ...
@@ -231,7 +231,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
231 231
             if (version == 5)
232 232
                 avio_r8(pb);
233 233
             codecdata_length = avio_rb32(pb);
234
-            if(codecdata_length + FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
234
+            if(codecdata_length + AV_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){
235 235
                 av_log(s, AV_LOG_ERROR, "codecdata_length too large\n");
236 236
                 return -1;
237 237
             }
... ...
@@ -119,7 +119,7 @@ int ff_h264_parse_sprop_parameter_sets(AVFormatContext *s,
119 119
             uint8_t *dest = av_realloc(*data_ptr,
120 120
                                        packet_size + sizeof(start_sequence) +
121 121
                                        *size_ptr +
122
-                                       FF_INPUT_BUFFER_PADDING_SIZE);
122
+                                       AV_INPUT_BUFFER_PADDING_SIZE);
123 123
             if (!dest) {
124 124
                 av_log(s, AV_LOG_ERROR,
125 125
                        "Unable to allocate memory for extradata!\n");
... ...
@@ -132,7 +132,7 @@ int ff_h264_parse_sprop_parameter_sets(AVFormatContext *s,
132 132
             memcpy(dest + *size_ptr + sizeof(start_sequence),
133 133
                    decoded_packet, packet_size);
134 134
             memset(dest + *size_ptr + sizeof(start_sequence) +
135
-                   packet_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
135
+                   packet_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
136 136
 
137 137
             *size_ptr += sizeof(start_sequence) + packet_size;
138 138
         }
... ...
@@ -148,7 +148,7 @@ static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index,
148 148
             codec->extradata_size = hevc_data->vps_size + hevc_data->sps_size +
149 149
                                     hevc_data->pps_size + hevc_data->sei_size;
150 150
             codec->extradata = av_malloc(codec->extradata_size +
151
-                                         FF_INPUT_BUFFER_PADDING_SIZE);
151
+                                         AV_INPUT_BUFFER_PADDING_SIZE);
152 152
             if (!codec->extradata) {
153 153
                 ret = AVERROR(ENOMEM);
154 154
                 codec->extradata_size = 0;
... ...
@@ -162,7 +162,7 @@ static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index,
162 162
                 pos += hevc_data->pps_size;
163 163
                 memcpy(codec->extradata + pos, hevc_data->sei, hevc_data->sei_size);
164 164
                 pos += hevc_data->sei_size;
165
-                memset(codec->extradata + pos, 0, FF_INPUT_BUFFER_PADDING_SIZE);
165
+                memset(codec->extradata + pos, 0, AV_INPUT_BUFFER_PADDING_SIZE);
166 166
             }
167 167
 
168 168
             av_freep(&hevc_data->vps);
... ...
@@ -97,7 +97,7 @@ static int parse_fmtp_config(AVStream *st, const char *value)
97 97
     int audio_mux_version, same_time_framing, num_programs, num_layers;
98 98
 
99 99
     /* Pad this buffer, too, to avoid out of bounds reads with get_bits below */
100
-    config = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
100
+    config = av_mallocz(len + AV_INPUT_BUFFER_PADDING_SIZE);
101 101
     if (!config)
102 102
         return AVERROR(ENOMEM);
103 103
     ff_hex_to_data(config, value);
... ...
@@ -118,7 +118,7 @@ static int parse_fmtp_config(AVStream *st, const char *value)
118 118
     av_freep(&st->codec->extradata);
119 119
     st->codec->extradata_size = (get_bits_left(&gb) + 7)/8;
120 120
     st->codec->extradata = av_mallocz(st->codec->extradata_size +
121
-                                      FF_INPUT_BUFFER_PADDING_SIZE);
121
+                                      AV_INPUT_BUFFER_PADDING_SIZE);
122 122
     if (!st->codec->extradata) {
123 123
         ret = AVERROR(ENOMEM);
124 124
         goto end;
... ...
@@ -102,7 +102,7 @@ static int parse_fmtp_config(AVCodecContext *codec, const char *value)
102 102
     /* decode the hexa encoded parameter */
103 103
     int len = ff_hex_to_data(NULL, value);
104 104
     av_free(codec->extradata);
105
-    codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
105
+    codec->extradata = av_mallocz(len + AV_INPUT_BUFFER_PADDING_SIZE);
106 106
     if (!codec->extradata)
107 107
         return AVERROR(ENOMEM);
108 108
     codec->extradata_size = len;
... ...
@@ -104,7 +104,7 @@ static int qdm2_parse_config(PayloadContext *qdm, AVStream *st,
104 104
                     return AVERROR_INVALIDDATA;
105 105
                 av_freep(&st->codec->extradata);
106 106
                 st->codec->extradata_size = 26 + item_len;
107
-                if (!(st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE))) {
107
+                if (!(st->codec->extradata = av_mallocz(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE))) {
108 108
                     st->codec->extradata_size = 0;
109 109
                     return AVERROR(ENOMEM);
110 110
                 }
... ...
@@ -174,14 +174,14 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
174 174
         if (qt->pkt.size > 0 && qt->timestamp == *timestamp) {
175 175
             int err;
176 176
             if ((err = av_reallocp(&qt->pkt.data, qt->pkt.size + alen +
177
-                                   FF_INPUT_BUFFER_PADDING_SIZE)) < 0) {
177
+                                   AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
178 178
                 qt->pkt.size = 0;
179 179
                 return err;
180 180
             }
181 181
         } else {
182 182
             av_freep(&qt->pkt.data);
183 183
             av_init_packet(&qt->pkt);
184
-            qt->pkt.data = av_realloc(NULL, alen + FF_INPUT_BUFFER_PADDING_SIZE);
184
+            qt->pkt.data = av_realloc(NULL, alen + AV_INPUT_BUFFER_PADDING_SIZE);
185 185
             if (!qt->pkt.data)
186 186
                 return AVERROR(ENOMEM);
187 187
             qt->pkt.size = 0;
... ...
@@ -198,7 +198,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
198 198
             qt->pkt.data = NULL;
199 199
             pkt->flags        = keyframe ? AV_PKT_FLAG_KEY : 0;
200 200
             pkt->stream_index = st->index;
201
-            memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
201
+            memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
202 202
             return 0;
203 203
         }
204 204
         return AVERROR(EAGAIN);
... ...
@@ -62,7 +62,7 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv,
62 62
         st->codec->extradata_size = 0;
63 63
 
64 64
         if (len < 2 || !(st->codec->extradata =
65
-                         av_malloc(len + 8 + FF_INPUT_BUFFER_PADDING_SIZE)))
65
+                         av_malloc(len + 8 + AV_INPUT_BUFFER_PADDING_SIZE)))
66 66
             return AVERROR_INVALIDDATA;
67 67
 
68 68
         st->codec->extradata_size = len + 8;
... ...
@@ -262,8 +262,8 @@ parse_packed_headers(const uint8_t * packed_headers,
262 262
     /* allocate extra space:
263 263
      * -- length/255 +2 for xiphlacing
264 264
      * -- one for the '2' marker
265
-     * -- FF_INPUT_BUFFER_PADDING_SIZE required */
266
-    extradata_alloc = length + length/255 + 3 + FF_INPUT_BUFFER_PADDING_SIZE;
265
+     * -- AV_INPUT_BUFFER_PADDING_SIZE required */
266
+    extradata_alloc = length + length/255 + 3 + AV_INPUT_BUFFER_PADDING_SIZE;
267 267
 
268 268
     ptr = codec->extradata = av_malloc(extradata_alloc);
269 269
     if (!ptr) {
... ...
@@ -120,7 +120,7 @@ static int vmd_read_header(AVFormatContext *s)
120 120
         vst->codec->height >>= 1;
121 121
     }
122 122
     vst->codec->extradata_size = VMD_HEADER_SIZE;
123
-    vst->codec->extradata = av_mallocz(VMD_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
123
+    vst->codec->extradata = av_mallocz(VMD_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
124 124
     memcpy(vst->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE);
125 125
 
126 126
     /* if sample rate is 0, assume no audio */
... ...
@@ -213,7 +213,7 @@ static int smacker_read_header(AVFormatContext *s)
213 213
 
214 214
     /* load trees to extradata, they will be unpacked by decoder */
215 215
     st->codec->extradata = av_mallocz(smk->treesize + 16 +
216
-                                      FF_INPUT_BUFFER_PADDING_SIZE);
216
+                                      AV_INPUT_BUFFER_PADDING_SIZE);
217 217
     st->codec->extradata_size = smk->treesize + 16;
218 218
     if(!st->codec->extradata){
219 219
         av_log(s, AV_LOG_ERROR,
... ...
@@ -161,7 +161,7 @@ static int smush_read_header(AVFormatContext *ctx)
161 161
         av_free(vst->codec->extradata);
162 162
         vst->codec->extradata_size = 1024 + 2;
163 163
         vst->codec->extradata = av_malloc(vst->codec->extradata_size +
164
-                                          FF_INPUT_BUFFER_PADDING_SIZE);
164
+                                          AV_INPUT_BUFFER_PADDING_SIZE);
165 165
         if (!vst->codec->extradata)
166 166
             return AVERROR(ENOMEM);
167 167
 
... ...
@@ -525,7 +525,7 @@ static int spdif_write_packet(struct AVFormatContext *s, AVPacket *pkt)
525 525
     if (ctx->extra_bswap ^ (ctx->spdif_flags & SPDIF_FLAG_BIGENDIAN)) {
526 526
     avio_write(s->pb, ctx->out_buf, ctx->out_bytes & ~1);
527 527
     } else {
528
-    av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + FF_INPUT_BUFFER_PADDING_SIZE);
528
+    av_fast_malloc(&ctx->buffer, &ctx->buffer_size, ctx->out_bytes + AV_INPUT_BUFFER_PADDING_SIZE);
529 529
     if (!ctx->buffer)
530 530
         return AVERROR(ENOMEM);
531 531
     ff_spdif_bswap_buf16((uint16_t *)ctx->buffer, (uint16_t *)ctx->out_buf, ctx->out_bytes >> 1);
... ...
@@ -71,7 +71,7 @@ static int tak_read_header(AVFormatContext *s)
71 71
         case TAK_METADATA_STREAMINFO:
72 72
         case TAK_METADATA_LAST_FRAME:
73 73
         case TAK_METADATA_ENCODER:
74
-            buffer = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
74
+            buffer = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
75 75
             if (!buffer)
76 76
                 return AVERROR(ENOMEM);
77 77
 
... ...
@@ -113,12 +113,12 @@ static int tta_read_header(AVFormatContext *s)
113 113
     st->codec->bits_per_coded_sample = bps;
114 114
 
115 115
     st->codec->extradata_size = avio_tell(s->pb) - start_offset;
116
-    if(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){
116
+    if(st->codec->extradata_size+AV_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){
117 117
         //this check is redundant as avio_read should fail
118 118
         av_log(s, AV_LOG_ERROR, "extradata_size too large\n");
119 119
         return -1;
120 120
     }
121
-    st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
121
+    st->codec->extradata = av_mallocz(st->codec->extradata_size+AV_INPUT_BUFFER_PADDING_SIZE);
122 122
     if (!st->codec->extradata) {
123 123
         st->codec->extradata_size = 0;
124 124
         return AVERROR(ENOMEM);
... ...
@@ -2241,7 +2241,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
2241 2241
             if (i > 0 && i < FF_MAX_EXTRADATA_SIZE) {
2242 2242
                 st->codec->extradata_size = i;
2243 2243
                 st->codec->extradata = av_mallocz(st->codec->extradata_size +
2244
-                                                  FF_INPUT_BUFFER_PADDING_SIZE);
2244
+                                                  AV_INPUT_BUFFER_PADDING_SIZE);
2245 2245
                 if (!st->codec->extradata)
2246 2246
                     return AVERROR(ENOMEM);
2247 2247
                 memcpy(st->codec->extradata, pkt->data,
... ...
@@ -3083,7 +3083,7 @@ int ff_generate_avci_extradata(AVStream *st)
3083 3083
 
3084 3084
     av_freep(&st->codec->extradata);
3085 3085
     st->codec->extradata_size = 0;
3086
-    st->codec->extradata      = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
3086
+    st->codec->extradata      = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
3087 3087
     if (!st->codec->extradata)
3088 3088
         return AVERROR(ENOMEM);
3089 3089
 
... ...
@@ -215,7 +215,7 @@ static int vqf_read_header(AVFormatContext *s)
215 215
     avpriv_set_pts_info(st, 64, size, st->codec->sample_rate);
216 216
 
217 217
     /* put first 12 bytes of COMM chunk in extradata */
218
-    if (!(st->codec->extradata = av_malloc(12 + FF_INPUT_BUFFER_PADDING_SIZE)))
218
+    if (!(st->codec->extradata = av_malloc(12 + AV_INPUT_BUFFER_PADDING_SIZE)))
219 219
         return AVERROR(ENOMEM);
220 220
     st->codec->extradata_size = 12;
221 221
     memcpy(st->codec->extradata, comm_chunk, 12);
... ...
@@ -102,7 +102,7 @@ static int wsvqa_read_header(AVFormatContext *s)
102 102
 
103 103
     /* the VQA header needs to go to the decoder */
104 104
     st->codec->extradata_size = VQA_HEADER_SIZE;
105
-    st->codec->extradata = av_mallocz(VQA_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
105
+    st->codec->extradata = av_mallocz(VQA_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
106 106
     header = (unsigned char *)st->codec->extradata;
107 107
     if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
108 108
         VQA_HEADER_SIZE) {
... ...
@@ -224,7 +224,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
224 224
                     case SND2_TAG:
225 225
                         st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_WS;
226 226
                         st->codec->extradata_size = 2;
227
-                        st->codec->extradata = av_mallocz(2 + FF_INPUT_BUFFER_PADDING_SIZE);
227
+                        st->codec->extradata = av_mallocz(2 + AV_INPUT_BUFFER_PADDING_SIZE);
228 228
                         if (!st->codec->extradata)
229 229
                             return AVERROR(ENOMEM);
230 230
                         AV_WL16(st->codec->extradata, wsvqa->version);
... ...
@@ -393,7 +393,7 @@ static int xmv_process_packet_header(AVFormatContext *s)
393 393
                     av_free(vst->codec->extradata);
394 394
 
395 395
                     vst->codec->extradata =
396
-                        av_malloc(4 + FF_INPUT_BUFFER_PADDING_SIZE);
396
+                        av_malloc(4 + AV_INPUT_BUFFER_PADDING_SIZE);
397 397
                     vst->codec->extradata_size = 4;
398 398
                 }
399 399
 
... ...
@@ -105,7 +105,7 @@ static int xwma_read_header(AVFormatContext *s)
105 105
                                   st->codec->extradata_size);
106 106
         } else {
107 107
             st->codec->extradata_size = 6;
108
-            st->codec->extradata      = av_mallocz(6 + FF_INPUT_BUFFER_PADDING_SIZE);
108
+            st->codec->extradata      = av_mallocz(6 + AV_INPUT_BUFFER_PADDING_SIZE);
109 109
             if (!st->codec->extradata)
110 110
                 return AVERROR(ENOMEM);
111 111
 
... ...
@@ -63,7 +63,7 @@ static int yop_read_header(AVFormatContext *s)
63 63
 
64 64
     // Extra data that will be passed to the decoder
65 65
 
66
-    video_stream->codec->extradata = av_mallocz(8 + FF_INPUT_BUFFER_PADDING_SIZE);
66
+    video_stream->codec->extradata = av_mallocz(8 + AV_INPUT_BUFFER_PADDING_SIZE);
67 67
 
68 68
     if (!video_stream->codec->extradata)
69 69
         return AVERROR(ENOMEM);