mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +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>
(cherry picked from commit fcdb012a10)
This commit is contained in:
@@ -980,6 +980,7 @@ 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
|
||||
@@ -996,5 +997,6 @@ 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 @@ 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 @@ 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