Commit d3abbb1d authored by Paul B Mahol's avatar Paul B Mahol

lavc: fix ff_alloc_packet()

Regression introduced in 740b9ff4.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 81fe2e8b
......@@ -1017,6 +1017,7 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int size)
return AVERROR(EINVAL);
}
if (avctx) {
av_assert0(!avpkt->data || avpkt->data != avctx->internal->byte_buffer);
if (!avpkt->data || avpkt->size < size) {
av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);
......@@ -1024,6 +1025,7 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int size)
avpkt->size = avctx->internal->byte_buffer_size;
avpkt->destruct = NULL;
}
}
if (avpkt->data) {
void *destruct = avpkt->destruct;
......
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