ff_formats_ref() takes a pointer to an AVFilterFormats and a pointer to a pointer to an AVFilterFormats as arguments and adds the latter as an owner to the list pointed to by the former; the latter is hereby always the address of a list contained in an AVFilterFormatsConfig and can therefore not be NULL. So remove the check for whether it is NULL; also do the same for ff_channel_layouts_ref(). Also do the same for the unref functions where argument is never NULL because it is always the address of an existing lvalue.
Unified · Split
| @@ -446,7 +446,7 @@ AVFilterChannelLayouts *ff_all_channel_counts(void) · 445 unmodified lines | ||
| 446 | 446 | #define FORMATS_REF(f, ref, unref_fn) \ |
| 447 | 447 | void *tmp; \ |
| 448 | 448 | \ |
| 449 | − if (!f || !ref) \ | |
| 449 | + if (!f) \ | |
| 450 | 450 | return AVERROR(ENOMEM); \ |
| 451 | 451 | \ |
| 452 | 452 | tmp = av_realloc_array(f->refs, sizeof(*f->refs), f->refcount + 1); \ |
| @@ -483,7 +483,7 @@ do { \ · 30 unmodified lines | ||
| 483 | 483 | do { \ |
| 484 | 484 | int idx = -1; \ |
| 485 | 485 | \ |
| 486 | − if (!ref || !*ref) \ | |
| 486 | + if (!*ref) \ | |
| 487 | 487 | return; \ |
| 488 | 488 | \ |
| 489 | 489 | FIND_REF_INDEX(ref, idx); \ |