diff mbox series

[FFmpeg-devel,4/5] avcodec/mjpegbdec: Don't create unnecessary AVFrame reference

Message ID AS8PR01MB79446E917CB014C056735EAA8FEF9@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State New
Headers show
Series [FFmpeg-devel,1/5] avcodec/mjpegdec: Always reset got_picture at the beginnig of decoding | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 14, 2022, 3:57 p.m. UTC
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@outlook.com>
---
 libavcodec/mjpegbdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index 8c1809e5fb..46b9eb377e 100644
--- a/libavcodec/mjpegbdec.c
+++ b/libavcodec/mjpegbdec.c
@@ -144,8 +144,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) {