It has been forgotten to free the name of the second outpad if attaching
the first one to the AVFilterContext fails. Fixing this is easy: Only
prepare the second outpad after (and if) the first outpad has been
successfully attached to the AVFilterContext.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
if (!pad.name)
return AVERROR(ENOMEM);
+ ret = ff_insert_outpad(ctx, 0, &pad);
+ if (ret < 0) {
+ av_freep(&pad.name);
+ return ret;
+ }
+
if (s->draw_curves) {
vpad = (AVFilterPad){
.name = av_strdup("out1"),
.config_props = config_video,
};
if (!vpad.name) {
- av_freep(&pad.name);
return AVERROR(ENOMEM);
}
- }
-
- ret = ff_insert_outpad(ctx, 0, &pad);
- if (ret < 0) {
- av_freep(&pad.name);
- return ret;
- }
-
- if (s->draw_curves) {
ret = ff_insert_outpad(ctx, 1, &vpad);
if (ret < 0) {
av_freep(&vpad.name);