avcodec/nvenc: Remove always-true check

nvenc_store_frame_data() is always called with frame != NULL
(checked at the beginning of nvenc_send_frame());
in fact, frame is dereferenced unconditionally after the block
guarded by the check for frame. Therefore Coverity complains
about this in issue #1538295.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-07-31 11:50:21 +02:00
parent 28817b90fc
commit 2d7c1479c2
1 changed files with 1 additions and 1 deletions

View File

@ -2249,7 +2249,7 @@ static int nvenc_store_frame_data(AVCodecContext *avctx, NV_ENC_PIC_PARAMS *pic_
// in case the encoder got reconfigured, there might be leftovers
av_buffer_unref(&frame_data->frame_opaque_ref);
if (frame && frame->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
if (frame->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
frame_data->frame_opaque_ref = av_buffer_ref(frame->opaque_ref);
if (!frame_data->frame_opaque_ref)
return AVERROR(ENOMEM);