Make parse_outputs() always return meaningful error codes.
Originally committed as revision 25698 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		
							parent
							
								
									00b3ca3c7a
								
							
						
					
					
						commit
						0cc8b65950
					
				@ -277,7 +277,7 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
 | 
				
			|||||||
                         AVFilterInOut **open_inputs,
 | 
					                         AVFilterInOut **open_inputs,
 | 
				
			||||||
                         AVFilterInOut **open_outputs, AVClass *log_ctx)
 | 
					                         AVFilterInOut **open_outputs, AVClass *log_ctx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int pad = 0;
 | 
					    int ret, pad = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    while (**buf == '[') {
 | 
					    while (**buf == '[') {
 | 
				
			||||||
        char *name = parse_link_name(buf, log_ctx);
 | 
					        char *name = parse_link_name(buf, log_ctx);
 | 
				
			||||||
@ -287,15 +287,15 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
 | 
				
			|||||||
        *curr_inputs = (*curr_inputs)->next;
 | 
					        *curr_inputs = (*curr_inputs)->next;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!name)
 | 
					        if (!name)
 | 
				
			||||||
            return -1;
 | 
					            return AVERROR(EINVAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* First check if the label is not in the open_inputs list */
 | 
					        /* First check if the label is not in the open_inputs list */
 | 
				
			||||||
        match = extract_inout(name, open_inputs);
 | 
					        match = extract_inout(name, open_inputs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (match) {
 | 
					        if (match) {
 | 
				
			||||||
            if (link_filter(input->filter, input->pad_idx,
 | 
					            if ((ret = link_filter(input->filter, input->pad_idx,
 | 
				
			||||||
                            match->filter, match->pad_idx, log_ctx) < 0)
 | 
					                                   match->filter, match->pad_idx, log_ctx)) < 0)
 | 
				
			||||||
                return -1;
 | 
					                return ret;
 | 
				
			||||||
            av_free(match->name);
 | 
					            av_free(match->name);
 | 
				
			||||||
            av_free(name);
 | 
					            av_free(name);
 | 
				
			||||||
            av_free(match);
 | 
					            av_free(match);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user