Originally committed as revision 13357 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavfilter/graphparser.c (1 of 1 file). Show all
Unified · Split
| @@ -144,8 +144,10 @@ static AVFilterContext *create_filter(AVFilterGraph *ctx, int index, · 143 unmodified lines | ||
| 144 | 144 | return NULL; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | − if(avfilter_graph_add_filter(ctx, filt) < 0) | |
| 147 | + if(avfilter_graph_add_filter(ctx, filt) < 0) { | |
| 148 | + avfilter_destroy(filt); | |
| 148 | 149 | return NULL; |
| 150 | + } | |
| 149 | 151 | |
| 150 | 152 | if(avfilter_init_filter(filt, args, NULL)) { |
| 151 | 153 | av_log(log_ctx, AV_LOG_ERROR, |
| @@ -164,19 +166,24 @@ static AVFilterContext *parse_filter(const char **buf, AVFilterGraph *graph, · 12 unmodified lines | ||
| 164 | 166 | { |
| 165 | 167 | char *opts = NULL; |
| 166 | 168 | char *name = consume_string(buf); |
| 169 | + AVFilterContext *ret; | |
| 167 | 170 | |
| 168 | 171 | if(**buf == '=') { |
| 169 | 172 | (*buf)++; |
| 170 | 173 | opts = consume_string(buf); |
| 171 | 174 | } |
| 172 | 175 | |
| 173 | − return create_filter(graph, index, name, opts, log_ctx); | |
| 176 | + ret = create_filter(graph, index, name, opts, log_ctx); | |
| 177 | + av_free(name); | |
| 178 | + av_free(opts); | |
| 179 | + return ret; | |
| 174 | 180 | } |
| 175 | 181 | |
| 176 | 182 | static void free_inout(AVFilterInOut *head) |
| 177 | 183 | { |
| 178 | 184 | while(head) { |
| 179 | 185 | AVFilterInOut *next = head->next; |
| 186 | + av_free(head->name); | |
| 180 | 187 | av_free(head); |
| 181 | 188 | head = next; |
| 182 | 189 | } |
| @@ -222,6 +229,7 @@ static int link_filter_inouts(AVFilterContext *filter, · 39 unmodified lines | ||
| 222 | 229 | if(p->filter) { |
| 223 | 230 | if(link_filter(p->filter, p->pad_idx, filter, pad, log_ctx)) |
| 224 | 231 | return -1; |
| 232 | + av_free(p->name); | |
| 225 | 233 | av_free(p); |
| 226 | 234 | } else { |
| 227 | 235 | p->filter = filter; |
| @@ -318,6 +326,8 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs, · 90 unmodified lines | ||
| 318 | 326 | if(link_filter(input->filter, input->pad_idx, |
| 319 | 327 | match->filter, match->pad_idx, log_ctx) < 0) |
| 320 | 328 | return -1; |
| 329 | + av_free(match->name); | |
| 330 | + av_free(name); | |
| 321 | 331 | av_free(match); |
| 322 | 332 | av_free(input); |
| 323 | 333 | } else { |