diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-02-24 22:39:19 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-03-03 06:31:41 +0100 |
commit | e42e9b0e4d3eb8b2c9b5e1791344f211b590040c (patch) | |
tree | 07342b1700f6d85c5f03043e41cf2f8a429805b0 /libavcodec | |
parent | c179c9e19d3b3a8bb98fcc65d2da1caa293f7919 (diff) | |
download | ffmpeg-e42e9b0e4d3eb8b2c9b5e1791344f211b590040c.tar.gz |
lavc: preserve avpkt->destruct in ff_alloc_packet().
Also, don't bother with saving/restoring data, av_init_packet doesn't
touch it.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d797c8a0b7..a91eab1ac1 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -838,14 +838,13 @@ int ff_alloc_packet(AVPacket *avpkt, int size) return AVERROR(EINVAL); if (avpkt->data) { - uint8_t *pkt_data; + void *destruct = avpkt->destruct; if (avpkt->size < size) return AVERROR(EINVAL); - pkt_data = avpkt->data; av_init_packet(avpkt); - avpkt->data = pkt_data; + avpkt->destruct = destruct; avpkt->size = size; return 0; } else { |