mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavc: preserve avpkt->destruct in ff_alloc_packet().
Also, don't bother with saving/restoring data, av_init_packet doesn't touch it.
This commit is contained in:
parent
c179c9e19d
commit
e42e9b0e4d
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user