Commit 44fe41a1 authored by Timo Rothenpieler's avatar Timo Rothenpieler

avcodec/nvenc: make sure newly allocated packets are refcounted

Fixes ticket 8383
Signed-off-by: 's avatarTimo Rothenpieler <timo@rothenpieler.org>
parent 61853f75
...@@ -1836,7 +1836,11 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur ...@@ -1836,7 +1836,11 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
goto error; goto error;
} }
if (res = ff_alloc_packet2(avctx, pkt, lock_params.bitstreamSizeInBytes,0)) { res = pkt->data ?
ff_alloc_packet2(avctx, pkt, lock_params.bitstreamSizeInBytes, lock_params.bitstreamSizeInBytes) :
av_new_packet(pkt, lock_params.bitstreamSizeInBytes);
if (res < 0) {
p_nvenc->nvEncUnlockBitstream(ctx->nvencoder, tmpoutsurf->output_surface); p_nvenc->nvEncUnlockBitstream(ctx->nvencoder, tmpoutsurf->output_surface);
goto error; goto error;
} }
......
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