diff mbox series

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

Message ID 20200914052747.124118-16-andreas.rheinhardt@gmail.com
State Accepted
Commit 39638ace670afd95b7094471a41f71af8c0cad33
Headers show
Series [FFmpeg-devel,01/16] avcodec/snowdec: Use ff_snow_common_init() directly
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 14, 2020, 5:27 a.m. UTC
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
function.

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

Comments

Paul B Mahol Sept. 14, 2020, 4:34 p.m. UTC | #1
On Mon, Sep 14, 2020 at 07:27:39AM +0200, Andreas Rheinhardt wrote:
> 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
> function.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/dsicinvideo.c | 1 -
>  1 file changed, 1 deletion(-)
> 

probably ok
diff mbox series

Patch

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);
         }
     }