1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavc/avpacket: Fix undefined behaviour, do not pass a null pointer to memcpy().

Fixes ticket #5128.
This commit is contained in:
Carl Eugen Hoyos 2016-09-04 21:11:02 +02:00
parent e7bc9623e5
commit f077ad69c6

View File

@ -581,7 +581,8 @@ int av_packet_ref(AVPacket *dst, const AVPacket *src)
ret = packet_alloc(&dst->buf, src->size);
if (ret < 0)
goto fail;
memcpy(dst->buf->data, src->data, src->size);
if (src->size)
memcpy(dst->buf->data, src->data, src->size);
dst->data = dst->buf->data;
} else {