Commit ed3a0254 authored by Andriy Lysnevych's avatar Andriy Lysnevych Committed by Michael Niedermayer

avcodec/avpacket: Respect payload offset in av_packet_ref

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 77d1e88c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment