diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-17 19:31:45 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-19 03:12:24 +0100 |
commit | a46d7819051e0e8c61017e75a0389389ae810ca4 (patch) | |
tree | 1279c1d1f15dc5b3b3a7a3eda9894026dfb8c8fe /libavcodec/avpacket.c | |
parent | 04d001ca9bc510be5bd1c75f6c8fe13751337799 (diff) |
avcodec/packet: Also change av_packet_pack/unpack_dictionary to size_t
These are auxiliary side-data functions, so they should have been
switched to size_t in d79e0fe65c51491f9bf8a470bbe36fb09f3e1280,
but this has been forgotten.
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/avpacket.c')
-rw-r--r-- | libavcodec/avpacket.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 8f0850fb00..b5bac5c5f2 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -507,7 +507,11 @@ int av_packet_split_side_data(AVPacket *pkt){ } #endif +#if FF_API_BUFFER_SIZE_T uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size) +#else +uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size) +#endif { uint8_t *data = NULL; *size = 0; @@ -526,7 +530,11 @@ uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size) if (pass) memcpy(data + total_length, str, len); +#if FF_API_BUFFER_SIZE_T else if (len > INT_MAX - total_length) +#else + else if (len > SIZE_MAX - total_length) +#endif return NULL; total_length += len; } @@ -542,7 +550,12 @@ uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size) return data; } +#if FF_API_BUFFER_SIZE_T int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict) +#else +int av_packet_unpack_dictionary(const uint8_t *data, size_t size, + AVDictionary **dict) +#endif { const uint8_t *end; int ret; |