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

Fixes ticket #5128.
pull/230/head
Carl Eugen Hoyos 8 years ago
parent e7bc9623e5
commit f077ad69c6
  1. 1
      libavcodec/avpacket.c

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

Loading…
Cancel
Save