diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-07-22 20:34:18 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-07-23 17:55:38 +0200 |
commit | 2654347d7adba61ab8a8cce470d657958f6f00f9 (patch) | |
tree | 754eb95f395f30b573b96cd0527e400ed8b43c0d /fftools | |
parent | 2a44c4bc9e2623e623981efe9f2510a45fce84f1 (diff) | |
download | ffmpeg-2654347d7adba61ab8a8cce470d657958f6f00f9.tar.gz |
fftools/ffmpeg_opt: Fix leak on error
Fixes Coverity issue #1539097.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'fftools')
-rw-r--r-- | fftools/ffmpeg_opt.c | 10 |
1 files changed, 6 insertions, 4 deletions
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 |