Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062.
Unified · Split
| @@ -2158,7 +2158,7 @@ static void show_packet(WriterContext *w, InputFile *ifile, AVPacket *pkt, int p · 2157 unmodified lines | ||
| 2158 | 2158 | pkt->flags & AV_PKT_FLAG_DISCARD ? 'D' : '_'); |
| 2159 | 2159 | |
| 2160 | 2160 | if (pkt->side_data_elems) { |
| 2161 | − int size; | |
| 2161 | + size_t size; | |
| 2162 | 2162 | const uint8_t *side_metadata; |
| 2163 | 2163 | |
| 2164 | 2164 | side_metadata = av_packet_get_side_data(pkt, AV_PKT_DATA_STRINGS_METADATA, &size); |
| @@ -3437,11 +3437,11 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data, · 3436 unmodified lines | ||
| 3437 | 3437 | int buf_consumed; |
| 3438 | 3438 | int buf_offset; |
| 3439 | 3439 | int err; |
| 3440 | − buffer_size_t new_extradata_size; | |
| 3440 | + size_t new_extradata_size; | |
| 3441 | 3441 | const uint8_t *new_extradata = av_packet_get_side_data(avpkt, |
| 3442 | 3442 | AV_PKT_DATA_NEW_EXTRADATA, |
| 3443 | 3443 | &new_extradata_size); |
| 3444 | − buffer_size_t jp_dualmono_size; | |
| 3444 | + size_t jp_dualmono_size; | |
| 3445 | 3445 | const uint8_t *jp_dualmono = av_packet_get_side_data(avpkt, |
| 3446 | 3446 | AV_PKT_DATA_JP_DUALMONO, |
| 3447 | 3447 | &jp_dualmono_size); |
| @@ -103,7 +103,7 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data, · 102 unmodified lines | ||
| 103 | 103 | const uint8_t *buf = avpkt->data; |
| 104 | 104 | const uint8_t *buf_end = buf + avpkt->size; |
| 105 | 105 | int num_blocks, ch, ret; |
| 106 | − buffer_size_t new_extradata_size; | |
| 106 | + size_t new_extradata_size; | |
| 107 | 107 | uint8_t *new_extradata; |
| 108 | 108 | |
| 109 | 109 | new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, |
| @@ -484,7 +484,7 @@ static int ffat_decode(AVCodecContext *avctx, void *data, · 483 unmodified lines | ||
| 484 | 484 | if (avctx->codec_id == AV_CODEC_ID_AAC) { |
| 485 | 485 | if (!at->extradata_size) { |
| 486 | 486 | uint8_t *side_data; |
| 487 | − buffer_size_t side_data_size; | |
| 487 | + size_t side_data_size; | |
| 488 | 488 | |
| 489 | 489 | side_data = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, |
| 490 | 490 | &side_data_size); |
| @@ -218,16 +218,12 @@ int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, · 217 unmodified lines | ||
| 218 | 218 | |
| 219 | 219 | |
| 220 | 220 | uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
| 221 | − buffer_size_t size) | |
| 221 | + size_t size) | |
| 222 | 222 | { |
| 223 | 223 | int ret; |
| 224 | 224 | uint8_t *data; |
| 225 | 225 | |
| 226 | −#if FF_API_BUFFER_SIZE_T | |
| 227 | − if ((unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) | |
| 228 | −#else | |
| 229 | 226 | if (size > SIZE_MAX - AV_INPUT_BUFFER_PADDING_SIZE) |
| 230 | −#endif | |
| 231 | 227 | return NULL; |
| 232 | 228 | data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); |
| 233 | 229 | if (!data) |
| @@ -243,7 +239,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, · 9 unmodified lines | ||
| 243 | 239 | } |
| 244 | 240 | |
| 245 | 241 | uint8_t *av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, |
| 246 | − buffer_size_t *size) | |
| 242 | + size_t *size) | |
| 247 | 243 | { |
| 248 | 244 | int i; |
| 249 | 245 | |
| @@ -297,11 +293,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type) · 47 unmodified lines | ||
| 297 | 293 | return NULL; |
| 298 | 294 | } |
| 299 | 295 | |
| 300 | −#if FF_API_BUFFER_SIZE_T | |
| 301 | −uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size) | |
| 302 | −#else | |
| 303 | 296 | uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size) |
| 304 | −#endif | |
| 305 | 297 | { |
| 306 | 298 | uint8_t *data = NULL; |
| 307 | 299 | *size = 0; |
| @@ -320,11 +312,7 @@ uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size) · 12 unmodified lines | ||
| 320 | 312 | |
| 321 | 313 | if (pass) |
| 322 | 314 | memcpy(data + total_length, str, len); |
| 323 | −#if FF_API_BUFFER_SIZE_T | |
| 324 | − else if (len > INT_MAX - total_length) | |
| 325 | −#else | |
| 326 | 315 | else if (len > SIZE_MAX - total_length) |
| 327 | −#endif | |
| 328 | 316 | return NULL; |
| 329 | 317 | total_length += len; |
| 330 | 318 | } |
| @@ -340,12 +328,8 @@ uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size) · 9 unmodified lines | ||
| 340 | 328 | return data; |
| 341 | 329 | } |
| 342 | 330 | |
| 343 | −#if FF_API_BUFFER_SIZE_T | |
| 344 | −int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict) | |
| 345 | −#else | |
| 346 | 331 | int av_packet_unpack_dictionary(const uint8_t *data, size_t size, |
| 347 | 332 | AVDictionary **dict) |
| 348 | −#endif | |
| 349 | 333 | { |
| 350 | 334 | const uint8_t *end; |
| 351 | 335 | int ret; |
| @@ -372,7 +356,7 @@ int av_packet_unpack_dictionary(const uint8_t *data, size_t size, · 20 unmodified lines | ||
| 372 | 356 | } |
| 373 | 357 | |
| 374 | 358 | int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
| 375 | − buffer_size_t size) | |
| 359 | + size_t size) | |
| 376 | 360 | { |
| 377 | 361 | int i; |
| 378 | 362 | |
| @@ -402,7 +386,7 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket *src) · 23 unmodified lines | ||
| 402 | 386 | dst->side_data_elems = 0; |
| 403 | 387 | for (i = 0; i < src->side_data_elems; i++) { |
| 404 | 388 | enum AVPacketSideDataType type = src->side_data[i].type; |
| 405 | − buffer_size_t size = src->side_data[i].size; | |
| 389 | + size_t size = src->side_data[i].size; | |
| 406 | 390 | uint8_t *src_data = src->side_data[i].data; |
| 407 | 391 | uint8_t *dst_data = av_packet_new_side_data(dst, type, size); |
| 408 | 392 | |
| @@ -599,7 +583,7 @@ void avpriv_packet_list_free(PacketList **pkt_buf, PacketList **pkt_buf_end) · 190 unmodified lines | ||
| 599 | 583 | int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type) |
| 600 | 584 | { |
| 601 | 585 | uint8_t *side_data; |
| 602 | − buffer_size_t side_data_size; | |
| 586 | + size_t side_data_size; | |
| 603 | 587 | int i; |
| 604 | 588 | |
| 605 | 589 | side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_STATS, &side_data_size); |
| @@ -625,7 +609,7 @@ int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp) · 19 unmodified lines | ||
| 625 | 609 | { |
| 626 | 610 | AVProducerReferenceTime *prft; |
| 627 | 611 | uint8_t *side_data; |
| 628 | − buffer_size_t side_data_size; | |
| 612 | + size_t side_data_size; | |
| 629 | 613 | |
| 630 | 614 | side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_PRFT, &side_data_size); |
| 631 | 615 | if (!side_data) { |
| @@ -24,7 +24,7 @@ static int cbs_bsf_update_side_data(AVBSFContext *bsf, AVPacket *pkt) · 23 unmodified lines | ||
| 24 | 24 | CBSBSFContext *ctx = bsf->priv_data; |
| 25 | 25 | CodedBitstreamFragment *frag = &ctx->fragment; |
| 26 | 26 | uint8_t *side_data; |
| 27 | − buffer_size_t side_data_size; | |
| 27 | + size_t side_data_size; | |
| 28 | 28 | int err; |
| 29 | 29 | |
| 30 | 30 | side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, |
| @@ -67,7 +67,7 @@ typedef struct FramePool { · 66 unmodified lines | ||
| 67 | 67 | static int apply_param_change(AVCodecContext *avctx, const AVPacket *avpkt) |
| 68 | 68 | { |
| 69 | 69 | int ret; |
| 70 | − buffer_size_t size; | |
| 70 | + size_t size; | |
| 71 | 71 | const uint8_t *data; |
| 72 | 72 | uint32_t flags; |
| 73 | 73 | int64_t val; |
| @@ -344,7 +344,7 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, · 270 unmodified lines | ||
| 344 | 344 | got_frame = 0; |
| 345 | 345 | } else if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) { |
| 346 | 346 | uint8_t *side; |
| 347 | − buffer_size_t side_size; | |
| 347 | + size_t side_size; | |
| 348 | 348 | uint32_t discard_padding = 0; |
| 349 | 349 | uint8_t skip_reason = 0; |
| 350 | 350 | uint8_t discard_reason = 0; |
| @@ -1463,7 +1463,7 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags · 1112 unmodified lines | ||
| 1463 | 1463 | |
| 1464 | 1464 | static int add_metadata_from_side_data(const AVPacket *avpkt, AVFrame *frame) |
| 1465 | 1465 | { |
| 1466 | − buffer_size_t size; | |
| 1466 | + size_t size; | |
| 1467 | 1467 | const uint8_t *side_metadata; |
| 1468 | 1468 | |
| 1469 | 1469 | AVDictionary **frame_md = &frame->metadata; |
| @@ -1502,7 +1502,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) · 32 unmodified lines | ||
| 1502 | 1502 | frame->pkt_size = pkt->size; |
| 1503 | 1503 | |
| 1504 | 1504 | for (int i = 0; i < FF_ARRAY_ELEMS(sd); i++) { |
| 1505 | − buffer_size_t size; | |
| 1505 | + size_t size; | |
| 1506 | 1506 | uint8_t *packet_sd = av_packet_get_side_data(pkt, sd[i].packet, &size); |
| 1507 | 1507 | if (packet_sd) { |
| 1508 | 1508 | AVFrameSideData *frame_sd = av_frame_new_side_data(frame, |
| @@ -1841,14 +1841,15 @@ FF_ENABLE_DEPRECATION_WARNINGS · 332 unmodified lines | ||
| 1841 | 1841 | |
| 1842 | 1842 | int ff_copy_palette(void *dst, const AVPacket *src, void *logctx) |
| 1843 | 1843 | { |
| 1844 | − buffer_size_t size; | |
| 1844 | + size_t size; | |
| 1845 | 1845 | const void *pal = av_packet_get_side_data(src, AV_PKT_DATA_PALETTE, &size); |
| 1846 | 1846 | |
| 1847 | 1847 | if (pal && size == AVPALETTE_SIZE) { |
| 1848 | 1848 | memcpy(dst, pal, AVPALETTE_SIZE); |
| 1849 | 1849 | return 1; |
| 1850 | 1850 | } else if (pal) { |
| 1851 | − av_log(logctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size); | |
| 1851 | + av_log(logctx, AV_LOG_ERROR, | |
| 1852 | + "Palette size %"SIZE_SPECIFIER" is wrong\n", size); | |
| 1852 | 1853 | } |
| 1853 | 1854 | return 0; |
| 1854 | 1855 | } |
| @@ -371,7 +371,7 @@ static int h264_metadata_handle_display_orientation(AVBSFContext *bsf, · 370 unmodified lines | ||
| 371 | 371 | H264RawSEIDisplayOrientation *disp = |
| 372 | 372 | &ctx->display_orientation_payload; |
| 373 | 373 | uint8_t *data; |
| 374 | − buffer_size_t size; | |
| 374 | + size_t size; | |
| 375 | 375 | int write = 0; |
| 376 | 376 | |
| 377 | 377 | data = av_packet_get_side_data(pkt, AV_PKT_DATA_DISPLAYMATRIX, &size); |
| @@ -975,7 +975,7 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data, · 974 unmodified lines | ||
| 975 | 975 | return send_next_delayed_frame(h, pict, got_frame, 0); |
| 976 | 976 | |
| 977 | 977 | if (av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, NULL)) { |
| 978 | − buffer_size_t side_size; | |
| 978 | + size_t side_size; | |
| 979 | 979 | uint8_t *side = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); |
| 980 | 980 | ff_h264_decode_extradata(side, side_size, |
| 981 | 981 | &h->ps, &h->is_avc, &h->nal_length_size, |
| @@ -3303,7 +3303,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output, · 3302 unmodified lines | ||
| 3303 | 3303 | AVPacket *avpkt) |
| 3304 | 3304 | { |
| 3305 | 3305 | int ret; |
| 3306 | − buffer_size_t new_extradata_size; | |
| 3306 | + size_t new_extradata_size; | |
| 3307 | 3307 | uint8_t *new_extradata; |
| 3308 | 3308 | HEVCContext *s = avctx->priv_data; |
| 3309 | 3309 | |
| @@ -221,7 +221,7 @@ static int vpx_decode(AVCodecContext *avctx, · 220 unmodified lines | ||
| 221 | 221 | struct vpx_image *img, *img_alpha; |
| 222 | 222 | int ret; |
| 223 | 223 | uint8_t *side_data = NULL; |
| 224 | − buffer_size_t side_data_size; | |
| 224 | + size_t side_data_size; | |
| 225 | 225 | |
| 226 | 226 | ret = decode_frame(avctx, &ctx->decoder, avpkt->data, avpkt->size); |
| 227 | 227 | if (ret) |
| @@ -575,8 +575,8 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number) · 574 unmodified lines | ||
| 575 | 575 | put_bits(&s->pb, 8, 0xff); // marker_bits |
| 576 | 576 | } else { |
| 577 | 577 | av_log(s->avctx, AV_LOG_WARNING, |
| 578 | − "Warning Closed Caption size (%d) can not exceed 93 bytes " | |
| 579 | − "and must be a multiple of 3\n", side_data->size); | |
| 578 | + "Closed Caption size (%"SIZE_SPECIFIER") can not exceed " | |
| 579 | + "93 bytes and must be a multiple of 3\n", side_data->size); | |
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | 582 | } |
| @@ -152,7 +152,7 @@ static int decode_frame(AVCodecContext *avctx, · 151 unmodified lines | ||
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { |
| 155 | − buffer_size_t size; | |
| 155 | + size_t size; | |
| 156 | 156 | const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size); |
| 157 | 157 | |
| 158 | 158 | if (pal && size == AVPALETTE_SIZE) { |
| @@ -160,7 +160,8 @@ static int decode_frame(AVCodecContext *avctx, · 1 unmodified line | ||
| 160 | 160 | for (j = 0; j < 256; j++) |
| 161 | 161 | s->pal[j] = 0xFF000000 | AV_RL32(pal + j * 4); |
| 162 | 162 | } else if (pal) { |
| 163 | − av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size); | |
| 163 | + av_log(avctx, AV_LOG_ERROR, | |
| 164 | + "Palette size %"SIZE_SPECIFIER" is wrong\n", size); | |
| 164 | 165 | } |
| 165 | 166 | memcpy(frame->data[1], s->pal, AVPALETTE_SIZE); |
| 166 | 167 | } |
| @@ -242,7 +242,7 @@ fail: · 241 unmodified lines | ||
| 242 | 242 | return ret; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | −static AVBufferRef *nvdec_decoder_frame_alloc(void *opaque, buffer_size_t size) | |
| 245 | +static AVBufferRef *nvdec_decoder_frame_alloc(void *opaque, size_t size) | |
| 246 | 246 | { |
| 247 | 247 | NVDECFramePool *pool = opaque; |
| 248 | 248 | AVBufferRef *ret; |
| @@ -283,7 +283,7 @@ static void nvdec_free_dummy(struct AVHWFramesContext *ctx) · 34 unmodified lines | ||
| 283 | 283 | av_buffer_pool_uninit(&ctx->pool); |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | −static AVBufferRef *nvdec_alloc_dummy(buffer_size_t size) | |
| 286 | +static AVBufferRef *nvdec_alloc_dummy(size_t size) | |
| 287 | 287 | { |
| 288 | 288 | return av_buffer_create(NULL, 0, NULL, NULL, 0); |
| 289 | 289 | } |
| @@ -305,11 +305,7 @@ enum AVPacketSideDataType { · 304 unmodified lines | ||
| 305 | 305 | |
| 306 | 306 | typedef struct AVPacketSideData { |
| 307 | 307 | uint8_t *data; |
| 308 | −#if FF_API_BUFFER_SIZE_T | |
| 309 | − int size; | |
| 310 | −#else | |
| 311 | 308 | size_t size; |
| 312 | −#endif | |
| 313 | 309 | enum AVPacketSideDataType type; |
| 314 | 310 | } AVPacketSideData; |
| 315 | 311 | |
| @@ -528,11 +524,7 @@ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size); · 212 unmodified lines | ||
| 528 | 524 | * @return pointer to fresh allocated data or NULL otherwise |
| 529 | 525 | */ |
| 530 | 526 | uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
| 531 | −#if FF_API_BUFFER_SIZE_T | |
| 532 | − int size); | |
| 533 | −#else | |
| 534 | 527 | size_t size); |
| 535 | −#endif | |
| 536 | 528 | |
| 537 | 529 | /** |
| 538 | 530 | * Wrap an existing array as a packet side data. |
| @@ -559,11 +551,7 @@ int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, · 20 unmodified lines | ||
| 559 | 551 | * @return 0 on success, < 0 on failure |
| 560 | 552 | */ |
| 561 | 553 | int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
| 562 | −#if FF_API_BUFFER_SIZE_T | |
| 563 | − int size); | |
| 564 | −#else | |
| 565 | 554 | size_t size); |
| 566 | −#endif | |
| 567 | 555 | |
| 568 | 556 | /** |
| 569 | 557 | * Get side information from packet. |
| @@ -575,11 +563,7 @@ int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, · 5 unmodified lines | ||
| 575 | 563 | * @return pointer to data if present or NULL otherwise |
| 576 | 564 | */ |
| 577 | 565 | uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, |
| 578 | −#if FF_API_BUFFER_SIZE_T | |
| 579 | − int *size); | |
| 580 | −#else | |
| 581 | 566 | size_t *size); |
| 582 | −#endif | |
| 583 | 567 | |
| 584 | 568 | const char *av_packet_side_data_name(enum AVPacketSideDataType type); |
| 585 | 569 | |
| @@ -590,11 +574,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type); · 4 unmodified lines | ||
| 590 | 574 | * @param size pointer to store the size of the returned data |
| 591 | 575 | * @return pointer to data if successful, NULL otherwise |
| 592 | 576 | */ |
| 593 | −#if FF_API_BUFFER_SIZE_T | |
| 594 | −uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size); | |
| 595 | −#else | |
| 596 | 577 | uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size); |
| 597 | −#endif | |
| 598 | 578 | /** |
| 599 | 579 | * Unpack a dictionary from side_data. |
| 600 | 580 | * |
| @@ -603,12 +583,8 @@ uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size); · 2 unmodified lines | ||
| 603 | 583 | * @param dict the metadata storage dictionary |
| 604 | 584 | * @return 0 on success, < 0 on failure |
| 605 | 585 | */ |
| 606 | −#if FF_API_BUFFER_SIZE_T | |
| 607 | −int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict); | |
| 608 | −#else | |
| 609 | 586 | int av_packet_unpack_dictionary(const uint8_t *data, size_t size, |
| 610 | 587 | AVDictionary **dict); |
| 611 | −#endif | |
| 612 | 588 | |
| 613 | 589 | /** |
| 614 | 590 | * Convenience function to free all the side data stored. |
| @@ -59,7 +59,7 @@ static int srt_decode_frame(AVCodecContext *avctx, · 58 unmodified lines | ||
| 59 | 59 | AVBPrint buffer; |
| 60 | 60 | int x1 = -1, y1 = -1, x2 = -1, y2 = -1; |
| 61 | 61 | int ret; |
| 62 | − buffer_size_t size; | |
| 62 | + size_t size; | |
| 63 | 63 | const uint8_t *p = av_packet_get_side_data(avpkt, AV_PKT_DATA_SUBTITLE_POSITION, &size); |
| 64 | 64 | FFASSDecoderContext *s = avctx->priv_data; |
| 65 | 65 | |
| @@ -2235,7 +2235,7 @@ static void vaapi_encode_free_output_buffer(void *opaque, · 2234 unmodified lines | ||
| 2235 | 2235 | } |
| 2236 | 2236 | |
| 2237 | 2237 | static AVBufferRef *vaapi_encode_alloc_output_buffer(void *opaque, |
| 2238 | − buffer_size_t size) | |
| 2238 | + size_t size) | |
| 2239 | 2239 | { |
| 2240 | 2240 | AVCodecContext *avctx = opaque; |
| 2241 | 2241 | VAAPIEncodeContext *ctx = avctx->priv_data; |
| @@ -936,7 +936,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 935 unmodified lines | ||
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | if (av_dict_set(&metadata_dict, "timecode", tc, 0) >= 0) { |
| 939 | − buffer_size_t metadata_len; | |
| 939 | + size_t metadata_len; | |
| 940 | 940 | packed_metadata = av_packet_pack_dictionary(metadata_dict, &metadata_len); |
| 941 | 941 | av_dict_free(&metadata_dict); |
| 942 | 942 | if (packed_metadata) { |
| @@ -1435,7 +1435,7 @@ int ff_decklink_read_packet(AVFormatContext *avctx, AVPacket *pkt) · 492 unmodified lines | ||
| 1435 | 1435 | avpacket_queue_get(&ctx->queue, pkt, 1); |
| 1436 | 1436 | |
| 1437 | 1437 | if (ctx->tc_format && !(av_dict_get(ctx->video_st->metadata, "timecode", NULL, 0))) { |
| 1438 | − buffer_size_t size; | |
| 1438 | + size_t size; | |
| 1439 | 1439 | const uint8_t *side_metadata = av_packet_get_side_data(pkt, AV_PKT_DATA_STRINGS_METADATA, &size); |
| 1440 | 1440 | if (side_metadata) { |
| 1441 | 1441 | if (av_packet_unpack_dictionary(side_metadata, size, &ctx->video_st->metadata) < 0) |
| @@ -313,7 +313,7 @@ static void construct_cc(AVFormatContext *avctx, struct decklink_ctx *ctx, · 312 unmodified lines | ||
| 313 | 313 | uint16_t *cdp_words; |
| 314 | 314 | uint16_t len; |
| 315 | 315 | uint8_t cc_count; |
| 316 | − buffer_size_t size; | |
| 316 | + size_t size; | |
| 317 | 317 | int ret, i; |
| 318 | 318 | |
| 319 | 319 | const uint8_t *data = av_packet_get_side_data(pkt, AV_PKT_DATA_A53_CC, &size); |
| @@ -446,7 +446,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt) · 445 unmodified lines | ||
| 446 | 446 | |
| 447 | 447 | frame_metadata = frame->metadata; |
| 448 | 448 | if (frame_metadata) { |
| 449 | − buffer_size_t size; | |
| 449 | + size_t size; | |
| 450 | 450 | uint8_t *metadata = av_packet_pack_dictionary(frame_metadata, &size); |
| 451 | 451 | |
| 452 | 452 | if (!metadata) { |
| @@ -236,7 +236,7 @@ static void free_shm_buffer(void *opaque, uint8_t *data) · 235 unmodified lines | ||
| 236 | 236 | shmdt(data); |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | −static AVBufferRef *allocate_shm_buffer(void *opaque, buffer_size_t size) | |
| 239 | +static AVBufferRef *allocate_shm_buffer(void *opaque, size_t size) | |
| 240 | 240 | { |
| 241 | 241 | xcb_connection_t *conn = opaque; |
| 242 | 242 | xcb_shm_seg_t segment; |
| @@ -170,7 +170,8 @@ static void dump_audio_service_type(AVFilterContext *ctx, AVFrameSideData *sd) · 169 unmodified lines | ||
| 170 | 170 | |
| 171 | 171 | static void dump_unknown(AVFilterContext *ctx, AVFrameSideData *sd) |
| 172 | 172 | { |
| 173 | − av_log(ctx, AV_LOG_INFO, "unknown side data type: %d, size %d bytes", sd->type, sd->size); | |
| 173 | + av_log(ctx, AV_LOG_INFO, "unknown side data type: %d, size " | |
| 174 | + "%"SIZE_SPECIFIER" bytes", sd->type, sd->size); | |
| 174 | 175 | } |
| 175 | 176 | |
| 176 | 177 | static int filter_frame(AVFilterLink *inlink, AVFrame *buf) |
| @@ -48,7 +48,7 @@ struct FFFramePool { · 47 unmodified lines | ||
| 48 | 48 | |
| 49 | 49 | }; |
| 50 | 50 | |
| 51 | −FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(buffer_size_t size), | |
| 51 | +FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size), | |
| 52 | 52 | int width, |
| 53 | 53 | int height, |
| 54 | 54 | enum AVPixelFormat format, |
| @@ -115,7 +115,7 @@ fail: · 60 unmodified lines | ||
| 115 | 115 | return NULL; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | −FFFramePool *ff_frame_pool_audio_init(AVBufferRef* (*alloc)(buffer_size_t size), | |
| 118 | +FFFramePool *ff_frame_pool_audio_init(AVBufferRef* (*alloc)(size_t size), | |
| 119 | 119 | int channels, |
| 120 | 120 | int nb_samples, |
| 121 | 121 | enum AVSampleFormat format, |
| @@ -44,7 +44,7 @@ typedef struct FFFramePool FFFramePool; · 43 unmodified lines | ||
| 44 | 44 | * @param align buffers alignement of each frame in this pool |
| 45 | 45 | * @return newly created video frame pool on success, NULL on error. |
| 46 | 46 | */ |
| 47 | −FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(buffer_size_t size), | |
| 47 | +FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size), | |
| 48 | 48 | int width, |
| 49 | 49 | int height, |
| 50 | 50 | enum AVPixelFormat format, |
| @@ -62,7 +62,7 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(buffer_size_t size), · 11 unmodified lines | ||
| 62 | 62 | * @param align buffers alignement of each frame in this pool |
| 63 | 63 | * @return newly created audio frame pool on success, NULL on error. |
| 64 | 64 | */ |
| 65 | −FFFramePool *ff_frame_pool_audio_init(AVBufferRef* (*alloc)(buffer_size_t size), | |
| 65 | +FFFramePool *ff_frame_pool_audio_init(AVBufferRef* (*alloc)(size_t size), | |
| 66 | 66 | int channels, |
| 67 | 67 | int samples, |
| 68 | 68 | enum AVSampleFormat format, |
| @@ -340,7 +340,8 @@ static void dump_sei_unregistered_metadata(AVFilterContext *ctx, const AVFrameSi · 339 unmodified lines | ||
| 340 | 340 | int i; |
| 341 | 341 | |
| 342 | 342 | if (sd->size < uuid_size) { |
| 343 | − av_log(ctx, AV_LOG_ERROR, "invalid data(%d < UUID(%d-bytes))\n", sd->size, uuid_size); | |
| 343 | + av_log(ctx, AV_LOG_ERROR, "invalid data(%"SIZE_SPECIFIER" < " | |
| 344 | + "UUID(%d-bytes))\n", sd->size, uuid_size); | |
| 344 | 345 | return; |
| 345 | 346 | } |
| 346 | 347 | |
| @@ -498,7 +499,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 151 unmodified lines | ||
| 498 | 499 | av_log(ctx, AV_LOG_INFO, "pan/scan"); |
| 499 | 500 | break; |
| 500 | 501 | case AV_FRAME_DATA_A53_CC: |
| 501 | − av_log(ctx, AV_LOG_INFO, "A/53 closed captions (%d bytes)", sd->size); | |
| 502 | + av_log(ctx, AV_LOG_INFO, "A/53 closed captions " | |
| 503 | + "(%"SIZE_SPECIFIER" bytes)", sd->size); | |
| 502 | 504 | break; |
| 503 | 505 | case AV_FRAME_DATA_SPHERICAL: |
| 504 | 506 | dump_spherical(ctx, frame, sd); |
| @@ -545,8 +547,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 40 unmodified lines | ||
| 545 | 547 | dump_sei_unregistered_metadata(ctx, sd); |
| 546 | 548 | break; |
| 547 | 549 | default: |
| 548 | − av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d bytes)\n", | |
| 549 | − sd->type, sd->size); | |
| 550 | + av_log(ctx, AV_LOG_WARNING, "unknown side data type %d " | |
| 551 | + "(%"SIZE_SPECIFIER" bytes)\n", sd->type, sd->size); | |
| 550 | 552 | break; |
| 551 | 553 | } |
| 552 | 554 | |
| @@ -170,7 +170,7 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt) · 169 unmodified lines | ||
| 170 | 170 | return 0; |
| 171 | 171 | if (!par->extradata_size) { |
| 172 | 172 | uint8_t *side_data; |
| 173 | − buffer_size_t side_data_size; | |
| 173 | + size_t side_data_size; | |
| 174 | 174 | int ret; |
| 175 | 175 | |
| 176 | 176 | side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, |
| @@ -119,7 +119,7 @@ static int flush_packet(AVFormatContext *format_context, AVPacket *packet) · 118 unmodified lines | ||
| 119 | 119 | AVIOContext *io_context = format_context->pb; |
| 120 | 120 | AVStream *codec_stream = format_context->streams[0]; |
| 121 | 121 | uint8_t *side_data = NULL; |
| 122 | − buffer_size_t side_data_size; | |
| 122 | + size_t side_data_size; | |
| 123 | 123 | |
| 124 | 124 | av_assert0(apng->prev_packet); |
| 125 | 125 | |
| @@ -1873,11 +1873,7 @@ int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, · 1872 unmodified lines | ||
| 1873 | 1873 | * @return pointer to fresh allocated data or NULL otherwise |
| 1874 | 1874 | */ |
| 1875 | 1875 | uint8_t *av_stream_new_side_data(AVStream *stream, |
| 1876 | −#if FF_API_BUFFER_SIZE_T | |
| 1877 | − enum AVPacketSideDataType type, int size); | |
| 1878 | −#else | |
| 1879 | 1876 | enum AVPacketSideDataType type, size_t size); |
| 1880 | −#endif | |
| 1881 | 1877 | /** |
| 1882 | 1878 | * Get side information from stream. |
| 1883 | 1879 | * |
| @@ -1888,11 +1884,7 @@ uint8_t *av_stream_new_side_data(AVStream *stream, · 4 unmodified lines | ||
| 1888 | 1884 | * @return pointer to data if present or NULL otherwise |
| 1889 | 1885 | */ |
| 1890 | 1886 | uint8_t *av_stream_get_side_data(const AVStream *stream, |
| 1891 | −#if FF_API_BUFFER_SIZE_T | |
| 1892 | − enum AVPacketSideDataType type, int *size); | |
| 1893 | −#else | |
| 1894 | 1887 | enum AVPacketSideDataType type, size_t *size); |
| 1895 | −#endif | |
| 1896 | 1888 | |
| 1897 | 1889 | AVProgram *av_new_program(AVFormatContext *s, int id); |
| 1898 | 1890 | |
| @@ -626,7 +626,7 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt) · 625 unmodified lines | ||
| 626 | 626 | av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &st->time_base), |
| 627 | 627 | av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base)); |
| 628 | 628 | if (cat->cur_file->metadata) { |
| 629 | − buffer_size_t metadata_len; | |
| 629 | + size_t metadata_len; | |
| 630 | 630 | char* packed_metadata = av_packet_pack_dictionary(cat->cur_file->metadata, &metadata_len); |
| 631 | 631 | if (!packed_metadata) |
| 632 | 632 | return AVERROR(ENOMEM); |
| @@ -1806,7 +1806,7 @@ static int update_stream_extradata(AVFormatContext *s, OutputStream *os, · 1805 unmodified lines | ||
| 1806 | 1806 | { |
| 1807 | 1807 | AVCodecParameters *par = os->ctx->streams[0]->codecpar; |
| 1808 | 1808 | uint8_t *extradata; |
| 1809 | − buffer_size_t extradata_size; | |
| 1809 | + size_t extradata_size; | |
| 1810 | 1810 | int ret; |
| 1811 | 1811 | |
| 1812 | 1812 | if (par->extradata_size) |
| @@ -2022,7 +2022,7 @@ static int dash_parse_prft(DASHContext *c, AVPacket *pkt) · 209 unmodified lines | ||
| 2022 | 2022 | { |
| 2023 | 2023 | OutputStream *os = &c->streams[pkt->stream_index]; |
| 2024 | 2024 | AVProducerReferenceTime *prft; |
| 2025 | − buffer_size_t side_data_size; | |
| 2025 | + size_t side_data_size; | |
| 2026 | 2026 | |
| 2027 | 2027 | prft = (AVProducerReferenceTime *)av_packet_get_side_data(pkt, AV_PKT_DATA_PRFT, &side_data_size); |
| 2028 | 2028 | if (!prft || side_data_size != sizeof(AVProducerReferenceTime) || (prft->flags && prft->flags != 24)) { |
| @@ -491,8 +491,8 @@ static void dump_sidedata(void *ctx, const AVStream *st, const char *indent) · 490 unmodified lines | ||
| 491 | 491 | dump_s12m_timecode(ctx, st, sd); |
| 492 | 492 | break; |
| 493 | 493 | default: |
| 494 | − av_log(ctx, AV_LOG_INFO, | |
| 495 | − "unknown side data type %d (%d bytes)", sd->type, sd->size); | |
| 494 | + av_log(ctx, AV_LOG_INFO, "unknown side data type %d " | |
| 495 | + "(%"SIZE_SPECIFIER" bytes)", sd->type, sd->size); | |
| 496 | 496 | break; |
| 497 | 497 | } |
| 498 | 498 | |
| @@ -280,7 +280,7 @@ static int flac_write_audio_packet(struct AVFormatContext *s, AVPacket *pkt) · 279 unmodified lines | ||
| 280 | 280 | { |
| 281 | 281 | FlacMuxerContext *c = s->priv_data; |
| 282 | 282 | uint8_t *streaminfo; |
| 283 | − buffer_size_t streaminfo_size; | |
| 283 | + size_t streaminfo_size; | |
| 284 | 284 | |
| 285 | 285 | /* check for updated streaminfo */ |
| 286 | 286 | streaminfo = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, |
| @@ -902,7 +902,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) · 901 unmodified lines | ||
| 902 | 902 | |
| 903 | 903 | if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264 |
| 904 | 904 | || par->codec_id == AV_CODEC_ID_MPEG4) { |
| 905 | − buffer_size_t side_size; | |
| 905 | + size_t side_size; | |
| 906 | 906 | uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); |
| 907 | 907 | if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) { |
| 908 | 908 | ret = ff_alloc_extradata(par, side_size); |
| @@ -88,7 +88,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) · 87 unmodified lines | ||
| 88 | 88 | case AV_PKT_DATA_SPHERICAL: |
| 89 | 89 | case AV_PKT_DATA_CONTENT_LIGHT_LEVEL: |
| 90 | 90 | case AV_PKT_DATA_S12M_TIMECODE: |
| 91 | − for (int j = 0; j < sd->size / 4; j++) { | |
| 91 | + for (size_t j = 0; j < sd->size / 4; j++) { | |
| 92 | 92 | uint8_t buf[4]; |
| 93 | 93 | AV_WL32(buf, AV_RB32(sd->data + 4 * j)); |
| 94 | 94 | side_data_crc = av_adler32_update(side_data_crc, buf, 4); |
| @@ -119,7 +119,9 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) · 24 unmodified lines | ||
| 119 | 119 | default: |
| 120 | 120 | side_data_crc = av_adler32_update(0, data, sd->size); |
| 121 | 121 | } |
| 122 | − av_strlcatf(buf, sizeof(buf), ", %8d, 0x%08"PRIx32, pkt->side_data[i].size, side_data_crc); | |
| 122 | + | |
| 123 | + av_strlcatf(buf, sizeof(buf), ", %8"SIZE_SPECIFIER", 0x%08"PRIx32, | |
| 124 | + pkt->side_data[i].size, side_data_crc); | |
| 123 | 125 | } |
| 124 | 126 | } |
| 125 | 127 | av_strlcatf(buf, sizeof(buf), "\n"); |
| @@ -298,18 +298,19 @@ static int framehash_write_packet(struct AVFormatContext *s, AVPacket *pkt) · 297 unmodified lines | ||
| 298 | 298 | avio_write(s->pb, buf, strlen(buf)); |
| 299 | 299 | |
| 300 | 300 | if (c->format_version > 1 && pkt->side_data_elems) { |
| 301 | − int i, j; | |
| 301 | + int i; | |
| 302 | 302 | avio_printf(s->pb, ", S=%d", pkt->side_data_elems); |
| 303 | 303 | for (i = 0; i < pkt->side_data_elems; i++) { |
| 304 | 304 | av_hash_init(c->hashes[0]); |
| 305 | 305 | if (HAVE_BIGENDIAN && pkt->side_data[i].type == AV_PKT_DATA_PALETTE) { |
| 306 | − for (j = 0; j < pkt->side_data[i].size; j += sizeof(uint32_t)) { | |
| 306 | + for (size_t j = 0; j < pkt->side_data[i].size; j += sizeof(uint32_t)) { | |
| 307 | 307 | uint32_t data = AV_RL32(pkt->side_data[i].data + j); |
| 308 | 308 | av_hash_update(c->hashes[0], (uint8_t *)&data, sizeof(uint32_t)); |
| 309 | 309 | } |
| 310 | 310 | } else |
| 311 | 311 | av_hash_update(c->hashes[0], pkt->side_data[i].data, pkt->side_data[i].size); |
| 312 | − snprintf(buf, sizeof(buf) - (AV_HASH_MAX_SIZE * 2 + 1), ", %8d, ", pkt->side_data[i].size); | |
| 312 | + snprintf(buf, sizeof(buf) - (AV_HASH_MAX_SIZE * 2 + 1), | |
| 313 | + ", %8"SIZE_SPECIFIER", ", pkt->side_data[i].size); | |
| 313 | 314 | len = strlen(buf); |
| 314 | 315 | av_hash_final_hex(c->hashes[0], buf + len, sizeof(buf) - len); |
| 315 | 316 | avio_write(s->pb, buf, strlen(buf)); |
| @@ -383,7 +383,7 @@ int ff_img_read_header(AVFormatContext *s1) · 382 unmodified lines | ||
| 383 | 383 | static int add_filename_as_pkt_side_data(char *filename, AVPacket *pkt) { |
| 384 | 384 | AVDictionary *d = NULL; |
| 385 | 385 | char *packed_metadata = NULL; |
| 386 | − buffer_size_t metadata_len; | |
| 386 | + size_t metadata_len; | |
| 387 | 387 | int ret; |
| 388 | 388 | |
| 389 | 389 | av_dict_set(&d, "lavf.image2dec.source_path", filename, 0); |
| @@ -176,7 +176,7 @@ static int latm_write_packet(AVFormatContext *s, AVPacket *pkt) · 175 unmodified lines | ||
| 176 | 176 | return ff_raw_write_packet(s, pkt); |
| 177 | 177 | else { |
| 178 | 178 | uint8_t *side_data; |
| 179 | − buffer_size_t side_data_size; | |
| 179 | + size_t side_data_size; | |
| 180 | 180 | int ret; |
| 181 | 181 | |
| 182 | 182 | side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, |
| @@ -2030,7 +2030,7 @@ static int mkv_write_block(AVFormatContext *s, AVIOContext *pb, · 2029 unmodified lines | ||
| 2030 | 2030 | AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar; |
| 2031 | 2031 | mkv_track *track = &mkv->tracks[pkt->stream_index]; |
| 2032 | 2032 | uint8_t *data = NULL, *side_data = NULL; |
| 2033 | − buffer_size_t side_data_size; | |
| 2033 | + size_t side_data_size; | |
| 2034 | 2034 | int err = 0, offset = 0, size = pkt->size; |
| 2035 | 2035 | int64_t ts = track->write_dts ? pkt->dts : pkt->pts; |
| 2036 | 2036 | uint64_t additional_id; |
| @@ -2141,7 +2141,7 @@ static int mkv_write_vtt_blocks(AVFormatContext *s, AVIOContext *pb, const AVPac · 104 unmodified lines | ||
| 2141 | 2141 | MatroskaMuxContext *mkv = s->priv_data; |
| 2142 | 2142 | mkv_track *track = &mkv->tracks[pkt->stream_index]; |
| 2143 | 2143 | ebml_master blockgroup; |
| 2144 | − buffer_size_t id_size, settings_size; | |
| 2144 | + size_t id_size, settings_size; | |
| 2145 | 2145 | int size, id_size_int, settings_size_int; |
| 2146 | 2146 | const char *id, *settings; |
| 2147 | 2147 | int64_t ts = track->write_dts ? pkt->dts : pkt->pts; |
| @@ -2214,7 +2214,7 @@ static int mkv_check_new_extra_data(AVFormatContext *s, const AVPacket *pkt) · 66 unmodified lines | ||
| 2214 | 2214 | mkv_track *track = &mkv->tracks[pkt->stream_index]; |
| 2215 | 2215 | AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar; |
| 2216 | 2216 | uint8_t *side_data; |
| 2217 | − buffer_size_t side_data_size; | |
| 2217 | + size_t side_data_size; | |
| 2218 | 2218 | int ret; |
| 2219 | 2219 | |
| 2220 | 2220 | side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, |
| @@ -6364,8 +6364,7 @@ static int mov_read_pssh(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 6363 unmodified lines | ||
| 6364 | 6364 | uint8_t **key_ids; |
| 6365 | 6365 | AVStream *st; |
| 6366 | 6366 | uint8_t *side_data, *extra_data, *old_side_data; |
| 6367 | − size_t side_data_size; | |
| 6368 | − buffer_size_t old_side_data_size; | |
| 6367 | + size_t side_data_size, old_side_data_size; | |
| 6369 | 6368 | int ret = 0; |
| 6370 | 6369 | unsigned int version, kid_count, extra_data_size, alloc_size = 0; |
| 6371 | 6370 | |
| @@ -1992,7 +1992,7 @@ static int mov_write_colr_tag(AVIOContext *pb, MOVTrack *track, int prefer_icc) · 1991 unmodified lines | ||
| 1992 | 1992 | // Ref (MP4): ISO/IEC 14496-12:2012 |
| 1993 | 1993 | |
| 1994 | 1994 | const uint8_t *icc_profile; |
| 1995 | − buffer_size_t icc_profile_size; | |
| 1995 | + size_t icc_profile_size; | |
| 1996 | 1996 | |
| 1997 | 1997 | if (prefer_icc) { |
| 1998 | 1998 | icc_profile = av_stream_get_side_data(track->st, AV_PKT_DATA_ICC_PROFILE, &icc_profile_size); |
| @@ -3046,7 +3046,7 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov, · 1047 unmodified lines | ||
| 3046 | 3046 | int group = 0; |
| 3047 | 3047 | |
| 3048 | 3048 | uint32_t *display_matrix = NULL; |
| 3049 | − buffer_size_t display_matrix_size; | |
| 3049 | + size_t display_matrix_size; | |
| 3050 | 3050 | int i; |
| 3051 | 3051 | |
| 3052 | 3052 | if (st) { |
| @@ -4173,7 +4173,7 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, · 1120 unmodified lines | ||
| 4173 | 4173 | track->tref_tag = MKTAG('h','i','n','t'); |
| 4174 | 4174 | track->tref_id = mov->tracks[track->src_track].track_id; |
| 4175 | 4175 | } else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) { |
| 4176 | − buffer_size_t size; | |
| 4176 | + size_t size; | |
| 4177 | 4177 | int *fallback; |
| 4178 | 4178 | fallback = (int*)av_stream_get_side_data(track->st, |
| 4179 | 4179 | AV_PKT_DATA_FALLBACK_TRACK, |
| @@ -5557,7 +5557,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) · 1377 unmodified lines | ||
| 5557 | 5557 | AVProducerReferenceTime *prft; |
| 5558 | 5558 | unsigned int samples_in_chunk = 0; |
| 5559 | 5559 | int size = pkt->size, ret = 0, offset = 0; |
| 5560 | − buffer_size_t prft_size; | |
| 5560 | + size_t prft_size; | |
| 5561 | 5561 | uint8_t *reformatted_data = NULL; |
| 5562 | 5562 | |
| 5563 | 5563 | ret = check_pkt(s, pkt); |
| @@ -5910,7 +5910,7 @@ static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt) · 346 unmodified lines | ||
| 5910 | 5910 | trk->par->codec_id == AV_CODEC_ID_AAC || |
| 5911 | 5911 | trk->par->codec_id == AV_CODEC_ID_AV1 || |
| 5912 | 5912 | trk->par->codec_id == AV_CODEC_ID_FLAC) { |
| 5913 | − buffer_size_t side_size; | |
| 5913 | + size_t side_size; | |
| 5914 | 5914 | uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); |
| 5915 | 5915 | if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) { |
| 5916 | 5916 | void *newextra = av_mallocz(side_size + AV_INPUT_BUFFER_PADDING_SIZE); |
| @@ -355,7 +355,7 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt) · 354 unmodified lines | ||
| 355 | 355 | |
| 356 | 356 | if (mp3->xing_offset) { |
| 357 | 357 | uint8_t *side_data = NULL; |
| 358 | − buffer_size_t side_data_size; | |
| 358 | + size_t side_data_size; | |
| 359 | 359 | |
| 360 | 360 | mp3_xing_add_frame(mp3, pkt); |
| 361 | 361 | mp3->audio_size += pkt->size; |
| @@ -402,7 +402,7 @@ static void mp3_update_xing(AVFormatContext *s) · 40 unmodified lines | ||
| 402 | 402 | AVReplayGain *rg; |
| 403 | 403 | uint16_t tag_crc; |
| 404 | 404 | uint8_t *toc; |
| 405 | − buffer_size_t rg_size; | |
| 405 | + size_t rg_size; | |
| 406 | 406 | int i; |
| 407 | 407 | int64_t old_pos = avio_tell(s->pb); |
| 408 | 408 | |
| @@ -1681,7 +1681,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) · 1680 unmodified lines | ||
| 1681 | 1681 | const int64_t max_audio_delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE) / 2; |
| 1682 | 1682 | int64_t dts = pkt->dts, pts = pkt->pts; |
| 1683 | 1683 | int opus_samples = 0; |
| 1684 | − buffer_size_t side_data_size; | |
| 1684 | + size_t side_data_size; | |
| 1685 | 1685 | uint8_t *side_data = NULL; |
| 1686 | 1686 | int stream_id = -1; |
| 1687 | 1687 | |
| @@ -1818,7 +1818,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) · 130 unmodified lines | ||
| 1818 | 1818 | /* Add Opus control header */ |
| 1819 | 1819 | if ((AV_RB16(pkt->data) >> 5) != 0x3ff) { |
| 1820 | 1820 | uint8_t *side_data; |
| 1821 | − buffer_size_t side_data_size; | |
| 1821 | + size_t side_data_size; | |
| 1822 | 1822 | int i, n; |
| 1823 | 1823 | int ctrl_header_size; |
| 1824 | 1824 | int trim_start = 0, trim_end = 0; |
| @@ -87,7 +87,7 @@ struct ogg_stream { · 86 unmodified lines | ||
| 87 | 87 | int start_trimming; ///< set the number of packets to drop from the start |
| 88 | 88 | int end_trimming; ///< set the number of packets to drop from the end |
| 89 | 89 | uint8_t *new_metadata; |
| 90 | − buffer_size_t new_metadata_size; | |
| 90 | + size_t new_metadata_size; | |
| 91 | 91 | void *private; |
| 92 | 92 | }; |
| 93 | 93 | |
| @@ -589,7 +589,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) · 588 unmodified lines | ||
| 589 | 589 | break; |
| 590 | 590 | case AV_CODEC_ID_H263: |
| 591 | 591 | if (s->flags & FF_RTP_FLAG_RFC2190) { |
| 592 | − buffer_size_t mb_info_size; | |
| 592 | + size_t mb_info_size; | |
| 593 | 593 | const uint8_t *mb_info = |
| 594 | 594 | av_packet_get_side_data(pkt, AV_PKT_DATA_H263_MB_INFO, |
| 595 | 595 | &mb_info_size); |
| @@ -856,7 +856,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt) · 855 unmodified lines | ||
| 856 | 856 | return AVERROR(EINVAL); |
| 857 | 857 | |
| 858 | 858 | if (!st->codecpar->extradata_size) { |
| 859 | − buffer_size_t pkt_extradata_size; | |
| 859 | + size_t pkt_extradata_size; | |
| 860 | 860 | uint8_t *pkt_extradata = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &pkt_extradata_size); |
| 861 | 861 | if (pkt_extradata && pkt_extradata_size > 0) { |
| 862 | 862 | ret = ff_alloc_extradata(st->codecpar, pkt_extradata_size); |
| @@ -61,7 +61,7 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt) · 60 unmodified lines | ||
| 61 | 61 | SRTContext *srt = avf->priv_data; |
| 62 | 62 | |
| 63 | 63 | int64_t s = pkt->pts, e, d = pkt->duration; |
| 64 | − buffer_size_t size; | |
| 64 | + size_t size; | |
| 65 | 65 | int x1 = -1, y1 = -1, x2 = -1, y2 = -1; |
| 66 | 66 | const uint8_t *p; |
| 67 | 67 | |
| @@ -5462,7 +5462,7 @@ int ff_generate_avci_extradata(AVStream *st) · 5461 unmodified lines | ||
| 5462 | 5462 | } |
| 5463 | 5463 | |
| 5464 | 5464 | uint8_t *av_stream_get_side_data(const AVStream *st, |
| 5465 | − enum AVPacketSideDataType type, buffer_size_t *size) | |
| 5465 | + enum AVPacketSideDataType type, size_t *size) | |
| 5466 | 5466 | { |
| 5467 | 5467 | int i; |
| 5468 | 5468 | |
| @@ -5515,7 +5515,7 @@ int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, · 46 unmodified lines | ||
| 5515 | 5515 | } |
| 5516 | 5516 | |
| 5517 | 5517 | uint8_t *av_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type, |
| 5518 | − buffer_size_t size) | |
| 5518 | + size_t size) | |
| 5519 | 5519 | { |
| 5520 | 5520 | int ret; |
| 5521 | 5521 | uint8_t *data = av_malloc(size); |
| @@ -5631,7 +5631,7 @@ int ff_standardize_creation_time(AVFormatContext *s) · 109 unmodified lines | ||
| 5631 | 5631 | int ff_get_packet_palette(AVFormatContext *s, AVPacket *pkt, int ret, uint32_t *palette) |
| 5632 | 5632 | { |
| 5633 | 5633 | uint8_t *side_data; |
| 5634 | − buffer_size_t size; | |
| 5634 | + size_t size; | |
| 5635 | 5635 | |
| 5636 | 5636 | side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_PALETTE, &size); |
| 5637 | 5637 | if (side_data) { |
| @@ -78,7 +78,7 @@ static int webvtt_read_header(AVFormatContext *s) · 77 unmodified lines | ||
| 78 | 78 | int64_t pos; |
| 79 | 79 | AVPacket *sub; |
| 80 | 80 | const char *p, *identifier, *settings; |
| 81 | − int identifier_len, settings_len; | |
| 81 | + size_t identifier_len, settings_len; | |
| 82 | 82 | int64_t ts_start, ts_end; |
| 83 | 83 | |
| 84 | 84 | ff_subtitles_read_chunk(s->pb, &cue); |
| @@ -64,7 +64,7 @@ static int webvtt_write_header(AVFormatContext *ctx) · 63 unmodified lines | ||
| 64 | 64 | static int webvtt_write_packet(AVFormatContext *ctx, AVPacket *pkt) |
| 65 | 65 | { |
| 66 | 66 | AVIOContext *pb = ctx->pb; |
| 67 | − buffer_size_t id_size, settings_size; | |
| 67 | + size_t id_size, settings_size; | |
| 68 | 68 | int id_size_int, settings_size_int; |
| 69 | 69 | uint8_t *id, *settings; |
| 70 | 70 | |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | #include "mem.h" |
| 27 | 27 | #include "thread.h" |
| 28 | 28 | |
| 29 | −AVBufferRef *av_buffer_create(uint8_t *data, buffer_size_t size, | |
| 29 | +AVBufferRef *av_buffer_create(uint8_t *data, size_t size, | |
| 30 | 30 | void (*free)(void *opaque, uint8_t *data), |
| 31 | 31 | void *opaque, int flags) |
| 32 | 32 | { |
| @@ -64,7 +64,7 @@ void av_buffer_default_free(void *opaque, uint8_t *data) · 31 unmodified lines | ||
| 64 | 64 | av_free(data); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | −AVBufferRef *av_buffer_alloc(buffer_size_t size) | |
| 67 | +AVBufferRef *av_buffer_alloc(size_t size) | |
| 68 | 68 | { |
| 69 | 69 | AVBufferRef *ret = NULL; |
| 70 | 70 | uint8_t *data = NULL; |
| @@ -80,7 +80,7 @@ AVBufferRef *av_buffer_alloc(buffer_size_t size) · 9 unmodified lines | ||
| 80 | 80 | return ret; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | −AVBufferRef *av_buffer_allocz(buffer_size_t size) | |
| 83 | +AVBufferRef *av_buffer_allocz(size_t size) | |
| 84 | 84 | { |
| 85 | 85 | AVBufferRef *ret = av_buffer_alloc(size); |
| 86 | 86 | if (!ret) |
| @@ -166,7 +166,7 @@ int av_buffer_make_writable(AVBufferRef **pbuf) · 79 unmodified lines | ||
| 166 | 166 | return 0; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | −int av_buffer_realloc(AVBufferRef **pbuf, buffer_size_t size) | |
| 169 | +int av_buffer_realloc(AVBufferRef **pbuf, size_t size) | |
| 170 | 170 | { |
| 171 | 171 | AVBufferRef *buf = *pbuf; |
| 172 | 172 | uint8_t *tmp; |
| @@ -242,8 +242,8 @@ int av_buffer_replace(AVBufferRef **pdst, AVBufferRef *src) · 69 unmodified lines | ||
| 242 | 242 | return 0; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | −AVBufferPool *av_buffer_pool_init2(buffer_size_t size, void *opaque, | |
| 246 | − AVBufferRef* (*alloc)(void *opaque, buffer_size_t size), | |
| 245 | +AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque, | |
| 246 | + AVBufferRef* (*alloc)(void *opaque, size_t size), | |
| 247 | 247 | void (*pool_free)(void *opaque)) |
| 248 | 248 | { |
| 249 | 249 | AVBufferPool *pool = av_mallocz(sizeof(*pool)); |
| @@ -263,7 +263,7 @@ AVBufferPool *av_buffer_pool_init2(buffer_size_t size, void *opaque, · 13 unmodified lines | ||
| 263 | 263 | return pool; |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | −AVBufferPool *av_buffer_pool_init(buffer_size_t size, AVBufferRef* (*alloc)(buffer_size_t size)) | |
| 266 | +AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size)) | |
| 267 | 267 | { |
| 268 | 268 | AVBufferPool *pool = av_mallocz(sizeof(*pool)); |
| 269 | 269 | if (!pool) |
| @@ -93,11 +93,7 @@ typedef struct AVBufferRef { · 92 unmodified lines | ||
| 93 | 93 | /** |
| 94 | 94 | * Size of data in bytes. |
| 95 | 95 | */ |
| 96 | −#if FF_API_BUFFER_SIZE_T | |
| 97 | − int size; | |
| 98 | −#else | |
| 99 | 96 | size_t size; |
| 100 | −#endif | |
| 101 | 97 | } AVBufferRef; |
| 102 | 98 | |
| 103 | 99 | /** |
| @@ -105,21 +101,13 @@ typedef struct AVBufferRef { · 1 unmodified line | ||
| 105 | 101 | * |
| 106 | 102 | * @return an AVBufferRef of given size or NULL when out of memory |
| 107 | 103 | */ |
| 108 | −#if FF_API_BUFFER_SIZE_T | |
| 109 | −AVBufferRef *av_buffer_alloc(int size); | |
| 110 | −#else | |
| 111 | 104 | AVBufferRef *av_buffer_alloc(size_t size); |
| 112 | −#endif | |
| 113 | 105 | |
| 114 | 106 | /** |
| 115 | 107 | * Same as av_buffer_alloc(), except the returned buffer will be initialized |
| 116 | 108 | * to zero. |
| 117 | 109 | */ |
| 118 | −#if FF_API_BUFFER_SIZE_T | |
| 119 | −AVBufferRef *av_buffer_allocz(int size); | |
| 120 | −#else | |
| 121 | 110 | AVBufferRef *av_buffer_allocz(size_t size); |
| 122 | −#endif | |
| 123 | 111 | |
| 124 | 112 | /** |
| 125 | 113 | * Always treat the buffer as read-only, even when it has only one |
| @@ -142,11 +130,7 @@ AVBufferRef *av_buffer_allocz(size_t size); · 16 unmodified lines | ||
| 142 | 130 | * |
| 143 | 131 | * @return an AVBufferRef referring to data on success, NULL on failure. |
| 144 | 132 | */ |
| 145 | −#if FF_API_BUFFER_SIZE_T | |
| 146 | −AVBufferRef *av_buffer_create(uint8_t *data, int size, | |
| 147 | −#else | |
| 148 | 133 | AVBufferRef *av_buffer_create(uint8_t *data, size_t size, |
| 149 | −#endif | |
| 150 | 134 | void (*free)(void *opaque, uint8_t *data), |
| 151 | 135 | void *opaque, int flags); |
| 152 | 136 | |
| @@ -214,11 +198,7 @@ int av_buffer_make_writable(AVBufferRef **buf); · 61 unmodified lines | ||
| 214 | 198 | * reference to it (i.e. the one passed to this function). In all other cases |
| 215 | 199 | * a new buffer is allocated and the data is copied. |
| 216 | 200 | */ |
| 217 | −#if FF_API_BUFFER_SIZE_T | |
| 218 | −int av_buffer_realloc(AVBufferRef **buf, int size); | |
| 219 | −#else | |
| 220 | 201 | int av_buffer_realloc(AVBufferRef **buf, size_t size); |
| 221 | −#endif | |
| 222 | 202 | |
| 223 | 203 | /** |
| 224 | 204 | * Ensure dst refers to the same data as src. |
| @@ -285,11 +265,7 @@ typedef struct AVBufferPool AVBufferPool; · 60 unmodified lines | ||
| 285 | 265 | * (av_buffer_alloc()). |
| 286 | 266 | * @return newly created buffer pool on success, NULL on error. |
| 287 | 267 | */ |
| 288 | −#if FF_API_BUFFER_SIZE_T | |
| 289 | −AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size)); | |
| 290 | −#else | |
| 291 | 268 | AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size)); |
| 292 | −#endif | |
| 293 | 269 | |
| 294 | 270 | /** |
| 295 | 271 | * Allocate and initialize a buffer pool with a more complex allocator. |
| @@ -306,13 +282,8 @@ AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size · 10 unmodified lines | ||
| 306 | 282 | * data. May be NULL. |
| 307 | 283 | * @return newly created buffer pool on success, NULL on error. |
| 308 | 284 | */ |
| 309 | −#if FF_API_BUFFER_SIZE_T | |
| 310 | −AVBufferPool *av_buffer_pool_init2(int size, void *opaque, | |
| 311 | − AVBufferRef* (*alloc)(void *opaque, int size), | |
| 312 | −#else | |
| 313 | 285 | AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque, |
| 314 | 286 | AVBufferRef* (*alloc)(void *opaque, size_t size), |
| 315 | −#endif | |
| 316 | 287 | void (*pool_free)(void *opaque)); |
| 317 | 288 | |
| 318 | 289 | /** |
| @@ -33,7 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | struct AVBuffer { |
| 35 | 35 | uint8_t *data; /**< data described by this buffer */ |
| 36 | − buffer_size_t size; /**< size of data in bytes */ | |
| 36 | + size_t size; /**< size of data in bytes */ | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * number of existing AVBufferRef instances referring to this buffer |
| @@ -90,10 +90,10 @@ struct AVBufferPool { · 50 unmodified lines | ||
| 90 | 90 | */ |
| 91 | 91 | atomic_uint refcount; |
| 92 | 92 | |
| 93 | − buffer_size_t size; | |
| 93 | + size_t size; | |
| 94 | 94 | void *opaque; |
| 95 | − AVBufferRef* (*alloc)(buffer_size_t size); | |
| 96 | − AVBufferRef* (*alloc2)(void *opaque, buffer_size_t size); | |
| 95 | + AVBufferRef* (*alloc)(size_t size); | |
| 96 | + AVBufferRef* (*alloc2)(void *opaque, size_t size); | |
| 97 | 97 | void (*pool_free)(void *opaque); |
| 98 | 98 | }; |
| 99 | 99 | |
| @@ -54,10 +54,6 @@ AVDetectionBBoxHeader *av_detection_bbox_create_side_data(AVFrame *frame, uint32 · 53 unmodified lines | ||
| 54 | 54 | header = av_detection_bbox_alloc(nb_bboxes, &size); |
| 55 | 55 | if (!header) |
| 56 | 56 | return NULL; |
| 57 | − if (size > INT_MAX) { | |
| 58 | − av_freep(&header); | |
| 59 | − return NULL; | |
| 60 | − } | |
| 61 | 57 | buf = av_buffer_create((uint8_t *)header, size, NULL, NULL, 0); |
| 62 | 58 | if (!buf) { |
| 63 | 59 | av_freep(&header); |
| @@ -603,7 +603,7 @@ AVFrameSideData *av_frame_new_side_data_from_buf(AVFrame *frame, · 602 unmodified lines | ||
| 603 | 603 | |
| 604 | 604 | AVFrameSideData *av_frame_new_side_data(AVFrame *frame, |
| 605 | 605 | enum AVFrameSideDataType type, |
| 606 | − buffer_size_t size) | |
| 606 | + size_t size) | |
| 607 | 607 | { |
| 608 | 608 | AVFrameSideData *ret; |
| 609 | 609 | AVBufferRef *buf = av_buffer_alloc(size); |
| @@ -209,11 +209,7 @@ enum AVActiveFormatDescription { · 208 unmodified lines | ||
| 209 | 209 | typedef struct AVFrameSideData { |
| 210 | 210 | enum AVFrameSideDataType type; |
| 211 | 211 | uint8_t *data; |
| 212 | −#if FF_API_BUFFER_SIZE_T | |
| 213 | − int size; | |
| 214 | −#else | |
| 215 | 212 | size_t size; |
| 216 | −#endif | |
| 217 | 213 | AVDictionary *metadata; |
| 218 | 214 | AVBufferRef *buf; |
| 219 | 215 | } AVFrameSideData; |
| @@ -818,11 +814,7 @@ AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane); · 598 unmodified lines | ||
| 818 | 814 | */ |
| 819 | 815 | AVFrameSideData *av_frame_new_side_data(AVFrame *frame, |
| 820 | 816 | enum AVFrameSideDataType type, |
| 821 | −#if FF_API_BUFFER_SIZE_T | |
| 822 | − int size); | |
| 823 | −#else | |
| 824 | 817 | size_t size); |
| 825 | −#endif | |
| 826 | 818 | |
| 827 | 819 | /** |
| 828 | 820 | * Add a new side data to a frame from an existing AVBufferRef |
| @@ -93,7 +93,7 @@ static void cuda_buffer_free(void *opaque, uint8_t *data) · 92 unmodified lines | ||
| 93 | 93 | CHECK_CU(cu->cuCtxPopCurrent(&dummy)); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | −static AVBufferRef *cuda_pool_alloc(void *opaque, buffer_size_t size) | |
| 96 | +static AVBufferRef *cuda_pool_alloc(void *opaque, size_t size) | |
| 97 | 97 | { |
| 98 | 98 | AVHWFramesContext *ctx = opaque; |
| 99 | 99 | AVHWDeviceContext *device_ctx = ctx->device_ctx; |
| @@ -202,7 +202,7 @@ static AVBufferRef *d3d11va_alloc_single(AVHWFramesContext *ctx) · 201 unmodified lines | ||
| 202 | 202 | return wrap_texture_buf(tex, 0); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | −static AVBufferRef *d3d11va_pool_alloc(void *opaque, buffer_size_t size) | |
| 205 | +static AVBufferRef *d3d11va_pool_alloc(void *opaque, size_t size) | |
| 206 | 206 | { |
| 207 | 207 | AVHWFramesContext *ctx = (AVHWFramesContext*)opaque; |
| 208 | 208 | D3D11VAFramesContext *s = ctx->internal->priv; |
| @@ -124,7 +124,7 @@ static void dxva2_pool_release_dummy(void *opaque, uint8_t *data) · 123 unmodified lines | ||
| 124 | 124 | // released in dxva2_frames_uninit() |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | −static AVBufferRef *dxva2_pool_alloc(void *opaque, buffer_size_t size) | |
| 127 | +static AVBufferRef *dxva2_pool_alloc(void *opaque, size_t size) | |
| 128 | 128 | { |
| 129 | 129 | AVHWFramesContext *ctx = (AVHWFramesContext*)opaque; |
| 130 | 130 | DXVA2FramesContext *s = ctx->internal->priv; |
| @@ -1617,7 +1617,7 @@ static void opencl_pool_free(void *opaque, uint8_t *data) · 1616 unmodified lines | ||
| 1617 | 1617 | av_free(desc); |
| 1618 | 1618 | } |
| 1619 | 1619 | |
| 1620 | −static AVBufferRef *opencl_pool_alloc(void *opaque, buffer_size_t size) | |
| 1620 | +static AVBufferRef *opencl_pool_alloc(void *opaque, size_t size) | |
| 1621 | 1621 | { |
| 1622 | 1622 | AVHWFramesContext *hwfc = opaque; |
| 1623 | 1623 | AVOpenCLDeviceContext *hwctx = hwfc->device_ctx->hwctx; |
| @@ -194,7 +194,7 @@ static void qsv_pool_release_dummy(void *opaque, uint8_t *data) · 193 unmodified lines | ||
| 194 | 194 | { |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | −static AVBufferRef *qsv_pool_alloc(void *opaque, buffer_size_t size) | |
| 197 | +static AVBufferRef *qsv_pool_alloc(void *opaque, size_t size) | |
| 198 | 198 | { |
| 199 | 199 | AVHWFramesContext *ctx = (AVHWFramesContext*)opaque; |
| 200 | 200 | QSVFramesContext *s = ctx->internal->priv; |
| @@ -464,7 +464,7 @@ static void vaapi_buffer_free(void *opaque, uint8_t *data) · 463 unmodified lines | ||
| 464 | 464 | } |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | −static AVBufferRef *vaapi_pool_alloc(void *opaque, buffer_size_t size) | |
| 467 | +static AVBufferRef *vaapi_pool_alloc(void *opaque, size_t size) | |
| 468 | 468 | { |
| 469 | 469 | AVHWFramesContext *hwfc = opaque; |
| 470 | 470 | VAAPIFramesContext *ctx = hwfc->internal->priv; |
| @@ -225,7 +225,7 @@ static void vdpau_buffer_free(void *opaque, uint8_t *data) · 224 unmodified lines | ||
| 225 | 225 | device_priv->surf_destroy(surf); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | −static AVBufferRef *vdpau_pool_alloc(void *opaque, buffer_size_t size) | |
| 228 | +static AVBufferRef *vdpau_pool_alloc(void *opaque, size_t size) | |
| 229 | 229 | { |
| 230 | 230 | AVHWFramesContext *ctx = opaque; |
| 231 | 231 | VDPAUFramesContext *priv = ctx->internal->priv; |
| @@ -1693,7 +1693,7 @@ static void try_export_flags(AVHWFramesContext *hwfc, · 1692 unmodified lines | ||
| 1693 | 1693 | } |
| 1694 | 1694 | } |
| 1695 | 1695 | |
| 1696 | −static AVBufferRef *vulkan_pool_alloc(void *opaque, buffer_size_t size) | |
| 1696 | +static AVBufferRef *vulkan_pool_alloc(void *opaque, size_t size) | |
| 1697 | 1697 | { |
| 1698 | 1698 | int err; |
| 1699 | 1699 | AVVkFrame *f; |
| @@ -292,11 +292,4 @@ void ff_check_pixfmt_descriptors(void); · 291 unmodified lines | ||
| 292 | 292 | */ |
| 293 | 293 | int avpriv_dict_set_timestamp(AVDictionary **dict, const char *key, int64_t timestamp); |
| 294 | 294 | |
| 295 | −// Temporary typedef to simplify porting all AVBufferRef users to size_t | |
| 296 | −#if FF_API_BUFFER_SIZE_T | |
| 297 | −typedef int buffer_size_t; | |
| 298 | −#else | |
| 299 | −typedef size_t buffer_size_t; | |
| 300 | −#endif | |
| 301 | − | |
| 302 | 295 | #endif /* AVUTIL_INTERNAL_H */ |
| @@ -108,9 +108,6 @@ · 107 unmodified lines | ||
| 108 | 108 | #ifndef FF_API_CHILD_CLASS_NEXT |
| 109 | 109 | #define FF_API_CHILD_CLASS_NEXT (LIBAVUTIL_VERSION_MAJOR < 57) |
| 110 | 110 | #endif |
| 111 | −#ifndef FF_API_BUFFER_SIZE_T | |
| 112 | −#define FF_API_BUFFER_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 57) | |
| 113 | −#endif | |
| 114 | 111 | #ifndef FF_API_CPU_FLAGS |
| 115 | 112 | #define FF_API_CPU_FLAGS (LIBAVUTIL_VERSION_MAJOR < 57) |
| 116 | 113 | #endif |
| @@ -63,10 +63,6 @@ av_video_enc_params_create_side_data(AVFrame *frame, enum AVVideoEncParamsType t · 62 unmodified lines | ||
| 63 | 63 | par = av_video_enc_params_alloc(type, nb_blocks, &size); |
| 64 | 64 | if (!par) |
| 65 | 65 | return NULL; |
| 66 | − if (size > INT_MAX) { | |
| 67 | − av_free(par); | |
| 68 | − return NULL; | |
| 69 | − } | |
| 70 | 66 | buf = av_buffer_create((uint8_t *)par, size, NULL, NULL, 0); |
| 71 | 67 | if (!buf) { |
| 72 | 68 | av_freep(&par); |