avcodec/cfhdenc: Fix leaks on allocation errors

The CineForm HD encoder attempts to allocate several buffers in its init
function; yet if only some of these allocations succeed, the
successfully allocated buffers leak. This is fixed 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>
pull/350/head
Andreas Rheinhardt 4 years ago
parent 82b6f4b556
commit a489b6a8e3
  1. 1
      libavcodec/cfhdenc.c

@ -919,4 +919,5 @@ AVCodec ff_cfhd_encoder = {
AV_PIX_FMT_GBRAP12,
AV_PIX_FMT_NONE
},
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

Loading…
Cancel
Save