You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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>
This commit is contained in:
@@ -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);
|
ret = GROW_ARRAY(o->audio_channel_maps, o->nb_audio_channel_maps);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto end;
|
||||||
|
|
||||||
m = &o->audio_channel_maps[o->nb_audio_channel_maps - 1];
|
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);
|
av_free(mapchan);
|
||||||
return 0;
|
return ret;
|
||||||
fail:
|
fail:
|
||||||
av_free(mapchan);
|
ret = AVERROR(EINVAL);
|
||||||
return AVERROR(EINVAL);
|
goto end;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user