Browse code

Make parse_outputs() always return meaningful error codes.

Originally committed as revision 25698 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini authored on 2010/11/08 03:40:12
Showing 1 changed files
... ...
@@ -277,7 +277,7 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
277 277
                          AVFilterInOut **open_inputs,
278 278
                          AVFilterInOut **open_outputs, AVClass *log_ctx)
279 279
 {
280
-    int pad = 0;
280
+    int ret, pad = 0;
281 281
 
282 282
     while (**buf == '[') {
283 283
         char *name = parse_link_name(buf, log_ctx);
... ...
@@ -287,15 +287,15 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
287 287
         *curr_inputs = (*curr_inputs)->next;
288 288
 
289 289
         if (!name)
290
-            return -1;
290
+            return AVERROR(EINVAL);
291 291
 
292 292
         /* First check if the label is not in the open_inputs list */
293 293
         match = extract_inout(name, open_inputs);
294 294
 
295 295
         if (match) {
296
-            if (link_filter(input->filter, input->pad_idx,
297
-                            match->filter, match->pad_idx, log_ctx) < 0)
298
-                return -1;
296
+            if ((ret = link_filter(input->filter, input->pad_idx,
297
+                                   match->filter, match->pad_idx, log_ctx)) < 0)
298
+                return ret;
299 299
             av_free(match->name);
300 300
             av_free(name);
301 301
             av_free(match);