[FFmpeg-cvslog] avcodec/rkmppdec: Check av_buffer_ref()

Andreas Rheinhardt git at videolan.org
Fri Apr 19 14:54:06 EEST 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Sep 24 13:32:08 2023 +0200| [9a0614c7bd4586e14d2047c32362bed565f9a669] | committer: Andreas Rheinhardt

avcodec/rkmppdec: Check av_buffer_ref()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a0614c7bd4586e14d2047c32362bed565f9a669
---

 libavcodec/rkmppdec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c
index 6889545b20..4e14d09c7c 100644
--- a/libavcodec/rkmppdec.c
+++ b/libavcodec/rkmppdec.c
@@ -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;



More information about the ffmpeg-cvslog mailing list