diff mbox series

[FFmpeg-devel,14/30] avcodec/indeo3: Cleanup generically after init failure

Message ID 20200915074000.102622-14-andreas.rheinhardt@gmail.com
State Accepted
Commit 3507ab07ecafb107574161bd7a2225616329816d
Headers show
Series [FFmpeg-devel,01/30] avcodec/flashsvenc: Avoid allocation of buffer, fix memleak
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. 15, 2020, 7:39 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/indeo3.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 71d478c9fc..75113a7541 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -203,10 +203,8 @@  static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
         ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
 
-        if (!ctx->planes[p].buffers[0] || !ctx->planes[p].buffers[1]) {
-            free_frame_buffers(ctx);
+        if (!ctx->planes[p].buffers[0] || !ctx->planes[p].buffers[1])
             return AVERROR(ENOMEM);
-        }
 
         /* fill the INTRA prediction lines with the middle pixel value = 64 */
         memset(ctx->planes[p].buffers[0], 0x40, ctx->planes[p].pitch);
@@ -1143,4 +1141,5 @@  AVCodec ff_indeo3_decoder = {
     .close          = decode_close,
     .decode         = decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };