int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict)
{
- const uint8_t *end = data + size;
+ const uint8_t *end;
int ret = 0;
if (!dict || !data || !size)
return ret;
+ end = data + size;
if (size && end[-1])
return AVERROR_INVALIDDATA;
while (data < end) {
ret = packet_alloc(&dst->buf, src->size);
if (ret < 0)
goto fail;
+ av_assert1(!src->size || src->data);
if (src->size)
memcpy(dst->buf->data, src->data, src->size);
ret = packet_alloc(&pkt->buf, pkt->size);
if (ret < 0)
return ret;
+ av_assert1(!pkt->size || pkt->data);
if (pkt->size)
memcpy(pkt->buf->data, pkt->data, pkt->size);
ret = packet_alloc(&buf, pkt->size);
if (ret < 0)
return ret;
+ av_assert1(!pkt->size || pkt->data);
if (pkt->size)
memcpy(buf->data, pkt->data, pkt->size);