Browse Source

avcodec/nvenc: make sure newly allocated packets are refcounted

Fixes ticket 8383

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
tags/n4.1.5
Timo Rothenpieler 6 years ago
parent
commit
4df5dfabcc
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavcodec/nvenc.c

+ 5
- 1
libavcodec/nvenc.c View File

@@ -1856,7 +1856,11 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
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);
goto error;
}


Loading…
Cancel
Save