avcodec/rkmppdec: Check av_buffer_ref()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-09-24 13:32:08 +02:00
parent 4513300989
commit 9a0614c7bd
1 changed files with 4 additions and 0 deletions

View File

@ -450,6 +450,10 @@ static int rkmpp_retrieve_frame(AVCodecContext *avctx, AVFrame *frame)
// MPP decoder needs to be closed only when all frames have been released.
framecontext = (RKMPPFrameContext *)framecontextref->data;
framecontext->decoder_ref = av_buffer_ref(rk_context->decoder_ref);
if (!framecontext->decoder_ref) {
ret = AVERROR(ENOMEM);
goto fail;
}
framecontext->frame = mppframe;
frame->data[0] = (uint8_t *)desc;