History

avfilter/formats: Remove pointless checks

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.

Andreas Rheinhardt committed 6 years ago

Commit 0963be71 parent 56169421 file · +2 −2Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/formats.c+2−2
@@ -446,7 +446,7 @@ AVFilterChannelLayouts *ff_all_channel_counts(void) · 445 unmodified lines
446446 #define FORMATS_REF(f, ref, unref_fn) \
447447 void *tmp; \
448448 \
449− if (!f || !ref) \
449+ if (!f) \
450450 return AVERROR(ENOMEM); \
451451 \
452452 tmp = av_realloc_array(f->refs, sizeof(*f->refs), f->refcount + 1); \
@@ -483,7 +483,7 @@ do { \ · 30 unmodified lines
483483 do { \
484484 int idx = -1; \
485485 \
486− if (!ref || !*ref) \
486+ if (!*ref) \
487487 return; \
488488 \
489489 FIND_REF_INDEX(ref, idx); \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t