Browse Source

avcodec/avpacket: Respect payload offset in av_packet_ref

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.1
Andriy Lysnevych Michael Niedermayer 9 years ago
parent
commit
ed3a02547c
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/avpacket.c

+ 3
- 1
libavcodec/avpacket.c View File

@@ -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);


Loading…
Cancel
Save