avcodec/utils, avcodec_open2: close codec on failure
authorJames Zern <jzern@google.com>
Wed, 10 Jul 2019 02:03:58 +0000 (19:03 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 Jul 2019 10:54:57 +0000 (12:54 +0200)
commitb1febda061955c6f4bfbc1a75918b5e75e7d7f80
tree45bc00b16c28b07f939ec8b32b24033e42f347f6
parent94d45a13c7e893538ca59bf6605a772c13f64f95
avcodec/utils, avcodec_open2: close codec on failure

after a successful init if the function fails for another reason close
the codec without requiring FF_CODEC_CAP_INIT_CLEANUP which is meant to
cover init failures themselves. fixes a memory leak in those cases.

BUG=oss-fuzz:15529

Signed-off-by: James Zern <jzern@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/utils.c