Browse Source

avcodec/magicyuvenc: Fix memleak upon init failure

If an error happens during init after an allocation has succeeded,
the already allocated data leaked up until now. Fix this by setting the
FF_CODEC_CAP_INIT_CLEANUP flag.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n4.4
Andreas Rheinhardt 5 years ago
parent
commit
a8ebb56320
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavcodec/magicyuvenc.c

+ 1
- 0
libavcodec/magicyuvenc.c View File

@@ -587,4 +587,5 @@ AVCodec ff_magicyuv_encoder = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
},
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

Loading…
Cancel
Save