Browse Source

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

Also, don't bother with saving/restoring data, av_init_packet doesn't
touch it.
tags/n0.11
Anton Khirnov 13 years ago
parent
commit
e42e9b0e4d
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      libavcodec/utils.c

+ 2
- 3
libavcodec/utils.c 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 {


Loading…
Cancel
Save