]> git.sesse.net Git - ffmpeg/commit
avcodec/j2kenc: Fix leaks on init failure
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 14 Sep 2020 23:29:58 +0000 (01:29 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 19 Sep 2020 16:47:39 +0000 (18:47 +0200)
commit3d83de4187e9bb07af2ea8a0ec071094fca7a500
treeeeae2fb4320ba80842fb9a2d6e1a0228e756e2fc
parent3507ab07ecafb107574161bd7a2225616329816d
avcodec/j2kenc: Fix leaks on init failure

The JPEG2000 encoder did not clean up after itself on error.
This commit fixes this by modifying the cleanup function to be able to
handle only partially allocated structures and 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>
libavcodec/j2kenc.c