diff options
Diffstat (limited to 'libavcodec/avpacket.c')
-rw-r--r-- | libavcodec/avpacket.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 132567bc2d..c622718a45 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -610,12 +610,13 @@ int av_packet_ref(AVPacket *dst, const AVPacket *src) { int ret; + dst->buf = NULL; + ret = av_packet_copy_props(dst, src); if (ret < 0) - return ret; + goto fail; if (!src->buf) { - dst->buf = NULL; ret = packet_alloc(&dst->buf, src->size); if (ret < 0) goto fail; @@ -637,7 +638,7 @@ int av_packet_ref(AVPacket *dst, const AVPacket *src) return 0; fail: - av_packet_free_side_data(dst); + av_packet_unref(dst); return ret; } |