ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@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.rheinha...@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;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to