Commit e42e9b0e authored by Anton Khirnov's avatar Anton Khirnov

lavc: preserve avpkt->destruct in ff_alloc_packet().

Also, don't bother with saving/restoring data, av_init_packet doesn't
touch it.
parent c179c9e1
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment