[FFmpeg-cvslog] avcodec/c93: Cleanup generically after init failure

Andreas Rheinhardt git at videolan.org
Thu Sep 17 01:10:12 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Sep 13 22:42:26 2020 +0200| [8de4a132ff5cf9efa1c35c78c881dc22ba255c10] | committer: Andreas Rheinhardt

avcodec/c93: Cleanup generically after init failure

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

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

diff --git a/libavcodec/c93.c b/libavcodec/c93.c
index e1808150b8..7e3bfdbc72 100644
--- a/libavcodec/c93.c
+++ b/libavcodec/c93.c
@@ -63,10 +63,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     s->pictures[0] = av_frame_alloc();
     s->pictures[1] = av_frame_alloc();
-    if (!s->pictures[0] || !s->pictures[1]) {
-        decode_end(avctx);
+    if (!s->pictures[0] || !s->pictures[1])
         return AVERROR(ENOMEM);
-    }
 
     return 0;
 }
@@ -269,5 +267,5 @@ AVCodec ff_c93_decoder = {
     .close          = decode_end,
     .decode         = decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
-    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
 };



More information about the ffmpeg-cvslog mailing list