summaryrefslogtreecommitdiff
path: root/libavcodec/avpacket.c
diff options
context:
space:
mode:
authorAndriy Lysnevych <andriy.lysnevych@gmail.com>2016-05-12 17:47:09 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-05-13 03:49:26 +0200
commited3a02547c71ac06fa27f17ad53116a74f78d927 (patch)
treed31310255f58f8d50f76e8d7c003d53a791bb61a /libavcodec/avpacket.c
parent77d1e88cf5282ea62c161db32de5092522d91cf5 (diff)
avcodec/avpacket: Respect payload offset in av_packet_ref
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/avpacket.c')
-rw-r--r--libavcodec/avpacket.c4
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);