summaryrefslogtreecommitdiff
path: root/libavcodec/avpacket.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/avpacket.c')
-rw-r--r--libavcodec/avpacket.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 88ec0be4a3..7a6195c1ba 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -442,9 +442,11 @@ uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size)
const size_t new_size = *size + keylen + 1 + valuelen + 1;
uint8_t *const new_data = av_realloc(data, new_size);
- if (!new_data || new_size > INT_MAX)
+ if (!new_data)
goto fail;
data = new_data;
+ if (new_size > INT_MAX)
+ goto fail;
memcpy(data + *size, t->key, keylen + 1);
memcpy(data + *size + keylen + 1, t->value, valuelen + 1);