History

avcodec: use the buffer_size_t typedef where required

James Almer committed 5 years ago

Commit d8a18c81 parent 42e68fe29 files · +41 −36Browse files

Unified · Split

29 files
  1. libavcodec/8bps.c +1 −1
  2. libavcodec/aacdec_template.c +2 −2
  3. libavcodec/adxdec.c +1 −1
  4. libavcodec/audiotoolboxdec.c +1 −1
  5. libavcodec/avpacket.c +3 −3
  6. libavcodec/cbs_bsf.c +1 −1
  7. libavcodec/cinepak.c +1 −1
  8. libavcodec/decode.c +5 −4
  9. libavcodec/gdv.c +2 −1
  10. libavcodec/h264_metadata_bsf.c +1 −1
  11. libavcodec/h264dec.c +1 −1
  12. libavcodec/hevcdec.c +1 −1
  13. libavcodec/idcinvideo.c +1 −1
  14. libavcodec/imx.c +2 −1
  15. libavcodec/interplayvideo.c +1 −1
  16. libavcodec/kmvc.c +1 −1
  17. libavcodec/libvpxdec.c +1 −1
  18. libavcodec/mscc.c +1 −1
  19. libavcodec/msrle.c +1 −1
  20. libavcodec/msvideo1.c +1 −1
  21. libavcodec/nvdec.c +2 −2
  22. libavcodec/qpeg.c +1 −1
  23. libavcodec/qtrle.c +1 −1
  24. libavcodec/rawdec.c +1 −1
  25. libavcodec/rscc.c +1 −1
  26. libavcodec/smc.c +1 −1
  27. libavcodec/srtdec.c +2 −1
  28. libavcodec/tscc.c +1 −1
  29. libavcodec/vaapi_encode.c +2 −1
libavcodec/8bps.c+1−1
@@ -122,7 +122,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, · 121 unmodified lines
122122 }
123123
124124 if (avctx->bits_per_coded_sample <= 8) {
125− int size;
125+ buffer_size_t size;
126126 const uint8_t *pal = av_packet_get_side_data(avpkt,
127127 AV_PKT_DATA_PALETTE,
128128 &size);
libavcodec/aacdec_template.c+2−2
@@ -3437,11 +3437,11 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data, · 3436 unmodified lines
34373437 int buf_consumed;
34383438 int buf_offset;
34393439 int err;
3440− int new_extradata_size;
3440+ buffer_size_t new_extradata_size;
34413441 const uint8_t *new_extradata = av_packet_get_side_data(avpkt,
34423442 AV_PKT_DATA_NEW_EXTRADATA,
34433443 &new_extradata_size);
3444− int jp_dualmono_size;
3444+ buffer_size_t jp_dualmono_size;
34453445 const uint8_t *jp_dualmono = av_packet_get_side_data(avpkt,
34463446 AV_PKT_DATA_JP_DUALMONO,
34473447 &jp_dualmono_size);
libavcodec/adxdec.c+1−1
@@ -103,7 +103,7 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data, · 102 unmodified lines
103103 const uint8_t *buf = avpkt->data;
104104 const uint8_t *buf_end = buf + avpkt->size;
105105 int num_blocks, ch, ret;
106− int new_extradata_size;
106+ buffer_size_t new_extradata_size;
107107 uint8_t *new_extradata;
108108
109109 new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
libavcodec/audiotoolboxdec.c+1−1
@@ -484,7 +484,7 @@ static int ffat_decode(AVCodecContext *avctx, void *data, · 483 unmodified lines
484484 if (avctx->codec_id == AV_CODEC_ID_AAC) {
485485 if (!at->extradata_size) {
486486 uint8_t *side_data;
487− int side_data_size;
487+ buffer_size_t side_data_size;
488488
489489 side_data = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
490490 &side_data_size);
libavcodec/avpacket.c+3−3
@@ -593,7 +593,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 592 unmodified lines
593593 dst->side_data_elems = 0;
594594 for (i = 0; i < src->side_data_elems; i++) {
595595 enum AVPacketSideDataType type = src->side_data[i].type;
596− int size = src->side_data[i].size;
596+ buffer_size_t size = src->side_data[i].size;
597597 uint8_t *src_data = src->side_data[i].data;
598598 uint8_t *dst_data = av_packet_new_side_data(dst, type, size);
599599
@@ -800,7 +800,7 @@ void avpriv_packet_list_free(AVPacketList **pkt_buf, AVPacketList **pkt_buf_end) · 200 unmodified lines
800800 int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type)
801801 {
802802 uint8_t *side_data;
803− int side_data_size;
803+ buffer_size_t side_data_size;
804804 int i;
805805
806806 side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_STATS, &side_data_size);
@@ -826,7 +826,7 @@ int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp) · 19 unmodified lines
826826 {
827827 AVProducerReferenceTime *prft;
828828 uint8_t *side_data;
829− int side_data_size;
829+ buffer_size_t side_data_size;
830830
831831 side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_PRFT, &side_data_size);
832832 if (!side_data) {
libavcodec/cbs_bsf.c+1−1
@@ -24,7 +24,7 @@ static int cbs_bsf_update_side_data(AVBSFContext *bsf, AVPacket *pkt) · 23 unmodified lines
2424 CBSBSFContext *ctx = bsf->priv_data;
2525 CodedBitstreamFragment *frag = &ctx->fragment;
2626 uint8_t *side_data;
27− int side_data_size;
27+ buffer_size_t side_data_size;
2828 int err;
2929
3030 side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
libavcodec/cinepak.c+1−1
@@ -477,7 +477,7 @@ static int cinepak_decode_frame(AVCodecContext *avctx, · 476 unmodified lines
477477 return ret;
478478
479479 if (s->palette_video) {
480− int size;
480+ buffer_size_t size;
481481 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
482482 if (pal && size == AVPALETTE_SIZE) {
483483 s->frame->palette_has_changed = 1;
libavcodec/decode.c+5−4
@@ -66,7 +66,8 @@ typedef struct FramePool { · 65 unmodified lines
6666
6767 static int apply_param_change(AVCodecContext *avctx, const AVPacket *avpkt)
6868 {
69− int size, ret;
69+ int ret;
70+ buffer_size_t size;
7071 const uint8_t *data;
7172 uint32_t flags;
7273 int64_t val;
@@ -349,7 +350,7 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, · 276 unmodified lines
349350 got_frame = 0;
350351 } else if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) {
351352 uint8_t *side;
352− int side_size;
353+ buffer_size_t side_size;
353354 uint32_t discard_padding = 0;
354355 uint8_t skip_reason = 0;
355356 uint8_t discard_reason = 0;
@@ -1709,7 +1710,7 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags · 1353 unmodified lines
17091710
17101711 static int add_metadata_from_side_data(const AVPacket *avpkt, AVFrame *frame)
17111712 {
1712− int size;
1713+ buffer_size_t size;
17131714 const uint8_t *side_metadata;
17141715
17151716 AVDictionary **frame_md = &frame->metadata;
@@ -1755,7 +1756,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 39 unmodified lines
17551756 frame->pkt_size = pkt->size;
17561757
17571758 for (i = 0; i < FF_ARRAY_ELEMS(sd); i++) {
1758− int size;
1759+ buffer_size_t size;
17591760 uint8_t *packet_sd = av_packet_get_side_data(pkt, sd[i].packet, &size);
17601761 if (packet_sd) {
17611762 AVFrameSideData *frame_sd = av_frame_new_side_data(frame,
libavcodec/gdv.c+2−1
@@ -461,7 +461,8 @@ static int gdv_decode_frame(AVCodecContext *avctx, void *data, · 460 unmodified lines
461461 GetByteContext *gb = &gdv->gb;
462462 PutByteContext *pb = &gdv->pb;
463463 AVFrame *frame = data;
464− int ret, i, pal_size;
464+ int ret, i;
465+ buffer_size_t pal_size;
465466 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
466467 int compression;
467468 unsigned flags;
libavcodec/h264_metadata_bsf.c+1−1
@@ -371,7 +371,7 @@ static int h264_metadata_handle_display_orientation(AVBSFContext *bsf, · 370 unmodified lines
371371 H264RawSEIDisplayOrientation *disp =
372372 &ctx->display_orientation_payload;
373373 uint8_t *data;
374− int size;
374+ buffer_size_t size;
375375 int write = 0;
376376
377377 data = av_packet_get_side_data(pkt, AV_PKT_DATA_DISPLAYMATRIX, &size);
libavcodec/h264dec.c+1−1
@@ -975,7 +975,7 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data, · 974 unmodified lines
975975 return send_next_delayed_frame(h, pict, got_frame, 0);
976976
977977 if (av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, NULL)) {
978− int side_size;
978+ buffer_size_t side_size;
979979 uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size);
980980 ff_h264_decode_extradata(side, side_size,
981981 &h->ps, &h->is_avc, &h->nal_length_size,
libavcodec/hevcdec.c+1−1
@@ -3303,7 +3303,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output, · 3302 unmodified lines
33033303 AVPacket *avpkt)
33043304 {
33053305 int ret;
3306− int new_extradata_size;
3306+ buffer_size_t new_extradata_size;
33073307 uint8_t *new_extradata;
33083308 HEVCContext *s = avctx->priv_data;
33093309
libavcodec/idcinvideo.c+1−1
@@ -214,7 +214,7 @@ static int idcin_decode_frame(AVCodecContext *avctx, · 213 unmodified lines
214214 const uint8_t *buf = avpkt->data;
215215 int buf_size = avpkt->size;
216216 IdcinContext *s = avctx->priv_data;
217− int pal_size;
217+ buffer_size_t pal_size;
218218 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
219219 AVFrame *frame = data;
220220 int ret;
libavcodec/imx.c+2−1
@@ -49,7 +49,8 @@ static int imx_decode_frame(AVCodecContext *avctx, void *data, · 48 unmodified lines
4949 int *got_frame, AVPacket *avpkt)
5050 {
5151 SimbiosisIMXContext *imx = avctx->priv_data;
52− int ret, x, y, pal_size;
52+ int ret, x, y;
53+ buffer_size_t pal_size;
5354 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
5455 AVFrame *frame = imx->frame;
5556 GetByteContext gb;
libavcodec/interplayvideo.c+1−1
@@ -1317,7 +1317,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx, · 1316 unmodified lines
13171317 return ret;
13181318
13191319 if (!s->is_16bpp) {
1320− int size;
1320+ buffer_size_t size;
13211321 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
13221322 if (pal && size == AVPALETTE_SIZE) {
13231323 frame->palette_has_changed = 1;
libavcodec/kmvc.c+1−1
@@ -268,7 +268,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame, · 267 unmodified lines
268268 int i, ret;
269269 int header;
270270 int blocksize;
271− int pal_size;
271+ buffer_size_t pal_size;
272272 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
273273
274274 bytestream2_init(&ctx->g, avpkt->data, avpkt->size);
libavcodec/libvpxdec.c+1−1
@@ -221,7 +221,7 @@ static int vpx_decode(AVCodecContext *avctx, · 220 unmodified lines
221221 struct vpx_image *img, *img_alpha;
222222 int ret;
223223 uint8_t *side_data = NULL;
224− int side_data_size;
224+ buffer_size_t side_data_size;
225225
226226 ret = decode_frame(avctx, &ctx->decoder, avpkt->data, avpkt->size);
227227 if (ret)
libavcodec/mscc.c+1−1
@@ -152,7 +152,7 @@ static int decode_frame(AVCodecContext *avctx, · 151 unmodified lines
152152 }
153153
154154 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
155− int size;
155+ buffer_size_t size;
156156 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
157157
158158 if (pal && size == AVPALETTE_SIZE) {
libavcodec/msrle.c+1−1
@@ -97,7 +97,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, · 96 unmodified lines
9797 return ret;
9898
9999 if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) {
100− int size;
100+ buffer_size_t size;
101101 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
102102
103103 if (pal && size == AVPALETTE_SIZE) {
libavcodec/msvideo1.c+1−1
@@ -314,7 +314,7 @@ static int msvideo1_decode_frame(AVCodecContext *avctx, · 313 unmodified lines
314314 return ret;
315315
316316 if (s->mode_8bit) {
317− int size;
317+ buffer_size_t size;
318318 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
319319
320320 if (pal && size == AVPALETTE_SIZE) {
libavcodec/nvdec.c+2−2
@@ -242,7 +242,7 @@ fail: · 241 unmodified lines
242242 return ret;
243243 }
244244
245−static AVBufferRef *nvdec_decoder_frame_alloc(void *opaque, int size)
245+static AVBufferRef *nvdec_decoder_frame_alloc(void *opaque, buffer_size_t size)
246246 {
247247 NVDECFramePool *pool = opaque;
248248 AVBufferRef *ret;
@@ -283,7 +283,7 @@ static void nvdec_free_dummy(struct AVHWFramesContext *ctx) · 34 unmodified lines
283283 av_buffer_pool_uninit(&ctx->pool);
284284 }
285285
286−static AVBufferRef *nvdec_alloc_dummy(int size)
286+static AVBufferRef *nvdec_alloc_dummy(buffer_size_t size)
287287 {
288288 return av_buffer_create(NULL, 0, NULL, NULL, 0);
289289 }
libavcodec/qpeg.c+1−1
@@ -274,7 +274,7 @@ static int decode_frame(AVCodecContext *avctx, · 273 unmodified lines
274274 AVFrame * const ref = a->ref;
275275 uint8_t* outdata;
276276 int delta, intra, ret;
277− int pal_size;
277+ buffer_size_t pal_size;
278278 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
279279
280280 if (avpkt->size < 0x86) {
libavcodec/qtrle.c+1−1
@@ -540,7 +540,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx, · 539 unmodified lines
540540 }
541541
542542 if(has_palette) {
543− int size;
543+ buffer_size_t size;
544544 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
545545
546546 if (pal && size == AVPALETTE_SIZE) {
libavcodec/rawdec.c+1−1
@@ -367,7 +367,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, · 366 unmodified lines
367367 }
368368
369369 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
370− int pal_size;
370+ buffer_size_t pal_size;
371371 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE,
372372 &pal_size);
373373 int ret;
libavcodec/rscc.c+1−1
@@ -346,7 +346,7 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data, · 345 unmodified lines
346346
347347 /* Palette handling */
348348 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
349− int size;
349+ buffer_size_t size;
350350 const uint8_t *palette = av_packet_get_side_data(avpkt,
351351 AV_PKT_DATA_PALETTE,
352352 &size);
libavcodec/smc.c+1−1
@@ -435,7 +435,7 @@ static int smc_decode_frame(AVCodecContext *avctx, · 434 unmodified lines
435435 const uint8_t *buf = avpkt->data;
436436 int buf_size = avpkt->size;
437437 SmcContext *s = avctx->priv_data;
438− int pal_size;
438+ buffer_size_t pal_size;
439439 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
440440 int ret;
441441 int total_blocks = ((s->avctx->width + 3) / 4) * ((s->avctx->height + 3) / 4);
libavcodec/srtdec.c+2−1
@@ -58,7 +58,8 @@ static int srt_decode_frame(AVCodecContext *avctx, · 57 unmodified lines
5858 AVSubtitle *sub = data;
5959 AVBPrint buffer;
6060 int x1 = -1, y1 = -1, x2 = -1, y2 = -1;
61− int size, ret;
61+ int ret;
62+ buffer_size_t size;
6263 const uint8_t *p = av_packet_get_side_data(avpkt, AV_PKT_DATA_SUBTITLE_POSITION, &size);
6364 FFASSDecoderContext *s = avctx->priv_data;
6465
libavcodec/tscc.c+1−1
@@ -72,7 +72,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, · 71 unmodified lines
7272 int palette_has_changed = 0;
7373
7474 if (c->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
75− int size;
75+ buffer_size_t size;
7676 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
7777
7878 if (pal && size == AVPALETTE_SIZE) {
libavcodec/vaapi_encode.c+2−1
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121
2222 #include "libavutil/avassert.h"
2323 #include "libavutil/common.h"
24+#include "libavutil/internal.h"
2425 #include "libavutil/log.h"
2526 #include "libavutil/pixdesc.h"
2627
@@ -2234,7 +2235,7 @@ static void vaapi_encode_free_output_buffer(void *opaque, · 2207 unmodified lines
22342235 }
22352236
22362237 static AVBufferRef *vaapi_encode_alloc_output_buffer(void *opaque,
2237− int size)
2238+ buffer_size_t size)
22382239 {
22392240 AVCodecContext *avctx = opaque;
22402241 VAAPIEncodeContext *ctx = avctx->priv_data;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t