[FFmpeg-cvslog] avcodec/mjpegbdec: Don't create unnecessary AVFrame reference

Andreas Rheinhardt git at videolan.org
Sat Sep 24 13:27:57 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Apr 14 17:57:39 2022 +0200| [2f9fa7e3e9e85c736e6ba87192ec8f32bdf069a7] | committer: Paul B Mahol

avcodec/mjpegbdec: Don't create unnecessary AVFrame reference

MJPEG-B is an intra-codec, so it makes no sense to keep the reference.
It is unused lateron anyway.

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

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

 libavcodec/mjpegbdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index dfc55d6cf8..98c64b44ca 100644
--- a/libavcodec/mjpegbdec.c
+++ b/libavcodec/mjpegbdec.c
@@ -142,8 +142,8 @@ read_header:
         return buf_size;
     }
 
-    if ((ret = av_frame_ref(rframe, s->picture_ptr)) < 0)
-        return ret;
+    av_frame_move_ref(rframe, s->picture_ptr);
+    s->got_picture = 0;
     *got_frame = 1;
 
     if (!s->lossless && avctx->debug & FF_DEBUG_QP) {



More information about the ffmpeg-cvslog mailing list