Message ID | AS8P250MB0744033A2B036E3DB2533E4B8F3CA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM |
---|---|
State | Accepted |
Commit | 2654347d7adba61ab8a8cce470d657958f6f00f9 |
Headers | show |
Series | [FFmpeg-devel,1/5] fftools/ffmpeg_mux_init: Fix leak on error | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 700db706a1..f7606ae6f6 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -497,7 +497,7 @@ static int opt_map_channel(void *optctx, const char *opt, const char *arg) ret = GROW_ARRAY(o->audio_channel_maps, o->nb_audio_channel_maps); if (ret < 0) - return ret; + goto end; m = &o->audio_channel_maps[o->nb_audio_channel_maps - 1]; @@ -559,11 +559,13 @@ static int opt_map_channel(void *optctx, const char *opt, const char *arg) } } + ret = 0; +end: av_free(mapchan); - return 0; + return ret; fail: - av_free(mapchan); - return AVERROR(EINVAL); + ret = AVERROR(EINVAL); + goto end; } #endif
Fixes Coverity issue #1539097. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- fftools/ffmpeg_opt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)