diff options
author | Andriy Lysnevych <andriy.lysnevych@gmail.com> | 2016-05-12 17:47:09 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-13 03:49:26 +0200 |
commit | ed3a02547c71ac06fa27f17ad53116a74f78d927 (patch) | |
tree | d31310255f58f8d50f76e8d7c003d53a791bb61a | |
parent | 77d1e88cf5282ea62c161db32de5092522d91cf5 (diff) | |
download | ffmpeg-ed3a02547c71ac06fa27f17ad53116a74f78d927.tar.gz |
avcodec/avpacket: Respect payload offset in av_packet_ref
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/avpacket.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 9cdfafd864..bcc7c79de7 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -568,16 +568,18 @@ int av_packet_ref(AVPacket *dst, const AVPacket *src) if (ret < 0) goto fail; memcpy(dst->buf->data, src->data, src->size); + dst->data = dst->buf->data; } else { dst->buf = av_buffer_ref(src->buf); if (!dst->buf) { ret = AVERROR(ENOMEM); goto fail; } + dst->data = src->data; } dst->size = src->size; - dst->data = dst->buf->data; + return 0; fail: av_packet_free_side_data(dst); |