mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/avpacket: Respect payload offset in av_packet_ref
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
77d1e88cf5
commit
ed3a02547c
@ -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…
x
Reference in New Issue
Block a user