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 | return NULL; | 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 | return NULL; | 149 | return NULL; |
| 150 | } | ||
| 149 | 151 | ||
| 150 | if(avfilter_init_filter(filt, args, NULL)) { | 152 | if(avfilter_init_filter(filt, args, NULL)) { |
| 151 | av_log(log_ctx, AV_LOG_ERROR, | 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 | char *opts = NULL; | 167 | char *opts = NULL; |
| 166 | char *name = consume_string(buf); | 168 | char *name = consume_string(buf); |
| 169 | AVFilterContext *ret; | ||
| 167 | 170 | ||
| 168 | if(**buf == '=') { | 171 | if(**buf == '=') { |
| 169 | (*buf)++; | 172 | (*buf)++; |
| 170 | opts = consume_string(buf); | 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 | static void free_inout(AVFilterInOut *head) | 182 | static void free_inout(AVFilterInOut *head) |
| 177 | { | 183 | { |
| 178 | while(head) { | 184 | while(head) { |
| 179 | AVFilterInOut *next = head->next; | 185 | AVFilterInOut *next = head->next; |
| 186 | av_free(head->name); | ||
| 180 | av_free(head); | 187 | av_free(head); |
| 181 | head = next; | 188 | head = next; |
| 182 | } | 189 | } |
| @@ -222,6 +229,7 @@ static int link_filter_inouts(AVFilterContext *filter, · 39 unmodified lines | |||
| 222 | if(p->filter) { | 229 | if(p->filter) { |
| 223 | if(link_filter(p->filter, p->pad_idx, filter, pad, log_ctx)) | 230 | if(link_filter(p->filter, p->pad_idx, filter, pad, log_ctx)) |
| 224 | return -1; | 231 | return -1; |
| 232 | av_free(p->name); | ||
| 225 | av_free(p); | 233 | av_free(p); |
| 226 | } else { | 234 | } else { |
| 227 | p->filter = filter; | 235 | p->filter = filter; |
| @@ -318,6 +326,8 @@ static int parse_outputs(const char **buf, AVFilterInOut **currInputs, · 90 unmodified lines | |||
| 318 | if(link_filter(input->filter, input->pad_idx, | 326 | if(link_filter(input->filter, input->pad_idx, |
| 319 | match->filter, match->pad_idx, log_ctx) < 0) | 327 | match->filter, match->pad_idx, log_ctx) < 0) |
| 320 | return -1; | 328 | return -1; |
| 329 | av_free(match->name); | ||
| 330 | av_free(name); | ||
| 321 | av_free(match); | 331 | av_free(match); |
| 322 | av_free(input); | 332 | av_free(input); |
| 323 | } else { | 333 | } else { |