1
0
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:
Anton Khirnov 2012-02-24 22:39:19 +01:00
parent c179c9e19d
commit e42e9b0e4d

View File

@ -838,14 +838,13 @@ int ff_alloc_packet(AVPacket *avpkt, int size)
return AVERROR(EINVAL); return AVERROR(EINVAL);
if (avpkt->data) { if (avpkt->data) {
uint8_t *pkt_data; void *destruct = avpkt->destruct;
if (avpkt->size < size) if (avpkt->size < size)
return AVERROR(EINVAL); return AVERROR(EINVAL);
pkt_data = avpkt->data;
av_init_packet(avpkt); av_init_packet(avpkt);
avpkt->data = pkt_data; avpkt->destruct = destruct;
avpkt->size = size; avpkt->size = size;
return 0; return 0;
} else { } else {