av_packet_add_side_data() already defines size as a size_t, so this makes it consistent across all side data functions
Unified · Split
| @@ -15,6 +15,10 @@ libavutil: 2017-10-21 · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | API changes, most recent first: | 16 | API changes, most recent first: |
| 17 | 17 | ||
| 18 | 2021-03-10 - xxxxxxxxxx - lavc 58.130.100 - packet.h | ||
| 19 | Change AVBufferRef related AVPacket function and struct size | ||
| 20 | parameter and fields type to size_t at next major bump. | ||
| 21 | |||
| 18 | 2021-03-10 - xxxxxxxxxx - lavu 56.68.100 - buffer.h frame.h | 22 | 2021-03-10 - xxxxxxxxxx - lavu 56.68.100 - buffer.h frame.h |
| 19 | Change AVBufferRef and relevant AVFrame function and struct size | 23 | Change AVBufferRef and relevant AVFrame function and struct size |
| 20 | parameter and fields type to size_t at next major bump. | 24 | parameter and fields type to size_t at next major bump. |
| @@ -330,12 +330,16 @@ int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, · 329 unmodified lines | |||
| 330 | 330 | ||
| 331 | 331 | ||
| 332 | uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, | 332 | uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
| 333 | int size) | 333 | buffer_size_t size) |
| 334 | { | 334 | { |
| 335 | int ret; | 335 | int ret; |
| 336 | uint8_t *data; | 336 | uint8_t *data; |
| 337 | 337 | ||
| 338 | #if FF_API_BUFFER_SIZE_T | ||
| 338 | if ((unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) | 339 | if ((unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) |
| 340 | #else | ||
| 341 | if (size > SIZE_MAX - AV_INPUT_BUFFER_PADDING_SIZE) | ||
| 342 | #endif | ||
| 339 | return NULL; | 343 | return NULL; |
| 340 | data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); | 344 | data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); |
| 341 | if (!data) | 345 | if (!data) |
| @@ -351,7 +355,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, · 9 unmodified lines | |||
| 351 | } | 355 | } |
| 352 | 356 | ||
| 353 | uint8_t *av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, | 357 | uint8_t *av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, |
| 354 | int *size) | 358 | buffer_size_t *size) |
| 355 | { | 359 | { |
| 356 | int i; | 360 | int i; |
| 357 | 361 | ||
| @@ -554,7 +558,7 @@ int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **di · 196 unmodified lines | |||
| 554 | } | 558 | } |
| 555 | 559 | ||
| 556 | int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, | 560 | int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
| 557 | int size) | 561 | buffer_size_t size) |
| 558 | { | 562 | { |
| 559 | int i; | 563 | int i; |
| 560 | 564 | ||
| @@ -305,7 +305,11 @@ enum AVPacketSideDataType { · 304 unmodified lines | |||
| 305 | 305 | ||
| 306 | typedef struct AVPacketSideData { | 306 | typedef struct AVPacketSideData { |
| 307 | uint8_t *data; | 307 | uint8_t *data; |
| 308 | #if FF_API_BUFFER_SIZE_T | ||
| 308 | int size; | 309 | int size; |
| 310 | #else | ||
| 311 | size_t size; | ||
| 312 | #endif | ||
| 309 | enum AVPacketSideDataType type; | 313 | enum AVPacketSideDataType type; |
| 310 | } AVPacketSideData; | 314 | } AVPacketSideData; |
| 311 | 315 | ||
| @@ -559,7 +563,11 @@ void av_free_packet(AVPacket *pkt); · 247 unmodified lines | |||
| 559 | * @return pointer to fresh allocated data or NULL otherwise | 563 | * @return pointer to fresh allocated data or NULL otherwise |
| 560 | */ | 564 | */ |
| 561 | uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, | 565 | uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
| 566 | #if FF_API_BUFFER_SIZE_T | ||
| 562 | int size); | 567 | int size); |
| 568 | #else | ||
| 569 | size_t size); | ||
| 570 | #endif | ||
| 563 | 571 | ||
| 564 | /** | 572 | /** |
| 565 | * Wrap an existing array as a packet side data. | 573 | * Wrap an existing array as a packet side data. |
| @@ -586,7 +594,11 @@ int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, · 20 unmodified lines | |||
| 586 | * @return 0 on success, < 0 on failure | 594 | * @return 0 on success, < 0 on failure |
| 587 | */ | 595 | */ |
| 588 | int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, | 596 | int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
| 597 | #if FF_API_BUFFER_SIZE_T | ||
| 589 | int size); | 598 | int size); |
| 599 | #else | ||
| 600 | size_t size); | ||
| 601 | #endif | ||
| 590 | 602 | ||
| 591 | /** | 603 | /** |
| 592 | * Get side information from packet. | 604 | * Get side information from packet. |
| @@ -598,7 +610,11 @@ int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, · 5 unmodified lines | |||
| 598 | * @return pointer to data if present or NULL otherwise | 610 | * @return pointer to data if present or NULL otherwise |
| 599 | */ | 611 | */ |
| 600 | uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, | 612 | uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, |
| 613 | #if FF_API_BUFFER_SIZE_T | ||
| 601 | int *size); | 614 | int *size); |
| 615 | #else | ||
| 616 | size_t *size); | ||
| 617 | #endif | ||
| 602 | 618 | ||
| 603 | #if FF_API_MERGE_SD_API | 619 | #if FF_API_MERGE_SD_API |
| 604 | attribute_deprecated | 620 | attribute_deprecated |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | |||
| 28 | #include "libavutil/version.h" | 28 | #include "libavutil/version.h" |
| 29 | 29 | ||
| 30 | #define LIBAVCODEC_VERSION_MAJOR 58 | 30 | #define LIBAVCODEC_VERSION_MAJOR 58 |
| 31 | #define LIBAVCODEC_VERSION_MINOR 129 | 31 | #define LIBAVCODEC_VERSION_MINOR 130 |
| 32 | #define LIBAVCODEC_VERSION_MICRO 100 | 32 | #define LIBAVCODEC_VERSION_MICRO 100 |
| 33 | 33 | ||
| 34 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ | 34 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |