[FFmpeg-devel] [PATCH 32/40] avcodec/dsicinvideo: Remove redundant code for freeing

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Mon Sep 14 08:27:39 EEST 2020

The dsicinvideo decoder already has the FF_CODEC_CAP_INIT_CLEANUP flag
set, so it is unnecessary to directly clean up some already allocated
buffers in case another one could not be allocated in the init function,
as all buffers will be freed anyway later in the decoder's close

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
 libavcodec/dsicinvideo.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/dsicinvideo.c b/libavcodec/dsicinvideo.c
index 7f74808e6d..52f660fb51 100644
--- a/libavcodec/dsicinvideo.c
+++ b/libavcodec/dsicinvideo.c
@@ -58,7 +58,6 @@ static av_cold int allocate_buffers(CinVideoContext *cin)
         cin->bitmap_table[i] = av_mallocz(cin->bitmap_size);
         if (!cin->bitmap_table[i]) {
             av_log(cin->avctx, AV_LOG_ERROR, "Can't allocate bitmap buffers.\n");
-            destroy_buffers(cin);
             return AVERROR(ENOMEM);

More information about the ffmpeg-devel mailing list