OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e62ff72
)
avpacket: fix setting AVPacket.data in av_packet_ref()
author
Anton Khirnov
<anton@khirnov.net>
Thu, 12 May 2016 13:34:58 +0000
(15:34 +0200)
committer
Anton Khirnov
<anton@khirnov.net>
Mon, 16 May 2016 08:31:08 +0000
(10:31 +0200)
The data field does not necessarily point to the beginning of the
underlying AVBuffer.
CC: libav-stable@libav.org
libavcodec/avpacket.c
patch
|
blob
|
history
diff --git
a/libavcodec/avpacket.c
b/libavcodec/avpacket.c
index
59fc6f2
..
04d6244
100644
(file)
--- a/
libavcodec/avpacket.c
+++ b/
libavcodec/avpacket.c
@@
-365,16
+365,19
@@
int av_packet_ref(AVPacket *dst, 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);