[FFmpeg-cvslog] avcodec/avpacket: Respect payload offset in av_packet_ref

Andriy Lysnevych git at videolan.org
Fri May 13 03:53:00 CEST 2016


ffmpeg | branch: master | Andriy Lysnevych <andriy.lysnevych at gmail.com> | Thu May 12 17:47:09 2016 +0300| [ed3a02547c71ac06fa27f17ad53116a74f78d927] | committer: Michael Niedermayer

avcodec/avpacket: Respect payload offset in av_packet_ref

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed3a02547c71ac06fa27f17ad53116a74f78d927
---

 libavcodec/avpacket.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 9cdfafd..bcc7c79 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);



More information about the ffmpeg-cvslog mailing list