Browse Source

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

Fixes ticket #5128.
tags/n3.2
Carl Eugen Hoyos 8 years ago
parent
commit
f077ad69c6
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/avpacket.c

+ 2
- 1
libavcodec/avpacket.c 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 {


Loading…
Cancel
Save