summaryrefslogtreecommitdiff
path: root/libavcodec/wmadec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-06 16:56:19 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-12 06:00:13 +0200
commitfcdb012a100b245890949b2d53cb7f042380787d (patch)
tree986a44635b3bbbd5d5f7720ed31e4479d41300ed /libavcodec/wmadec.c
parent0bc522a0a1c83894fbf7975e17de19ca34a02ae0 (diff)
avcodec/wma(dec|enc): Fix memleaks upon allocation error
ff_wma_init() can fail without freeing everything it has allocated; so add the FF_CODEC_CAP_INIT_CLEANUP to the codecs using it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/wmadec.c')
-rw-r--r--libavcodec/wmadec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 9081f35a16..b63ce66b23 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -977,6 +977,7 @@ const AVCodec ff_wmav1_decoder = {
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
#endif
#if CONFIG_WMAV2_DECODER
@@ -993,5 +994,6 @@ const AVCodec ff_wmav2_decoder = {
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
#endif