You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
@@ -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
|
||||
|
@@ -436,6 +436,7 @@ const AVCodec ff_wmav1_encoder = {
|
||||
.close = ff_wma_end,
|
||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||
};
|
||||
#endif
|
||||
#if CONFIG_WMAV2_ENCODER
|
||||
@@ -450,5 +451,6 @@ const AVCodec ff_wmav2_encoder = {
|
||||
.close = ff_wma_end,
|
||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||
};
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user