Remove some superfluous NULL checks

In all of these situations, NULL is logically not allowed, making the
checks redundant.

Coverity complained about accessing the pointers before checking them
for NULL later.
This commit is contained in:
wm4 2014-11-21 05:12:55 +01:00
parent 4704fab82c
commit 85fb2af369
4 changed files with 3 additions and 7 deletions

View File

@ -1969,8 +1969,7 @@ static int probe_deint_filters(struct MPContext *mpctx)
if (check_output_format(mpctx, IMGFMT_VDPAU)) {
char filter[80] = "vdpaupp:deint=yes";
int pref = 0;
if (mpctx->video_out)
vo_control(mpctx->video_out, VOCTRL_GET_PREF_DEINT, &pref);
vo_control(mpctx->video_out, VOCTRL_GET_PREF_DEINT, &pref);
pref = pref < 0 ? -pref : pref;
if (pref > 0 && pref <= 4) {
const char *types[] =

View File

@ -268,7 +268,7 @@ static bool needs_config_quoting(const char *s)
{
if (s[0] == '%')
return true;
for (int i = 0; s && s[i]; i++) {
for (int i = 0; s[i]; i++) {
unsigned char c = s[i];
if (!mp_isprint(c) || mp_isspace(c) || c == '#' || c == '\'' || c == '"')
return true;

View File

@ -202,9 +202,6 @@ int reinit_video_filters(struct MPContext *mpctx)
if (need_reconfig)
filter_reconfig(mpctx, true);
if (!d_video->vfilter)
return 0;
return d_video->vfilter->initialized;
}

View File

@ -247,7 +247,7 @@ bool ta_asprintf_append(char **str, const char *fmt, ...)
bool ta_vasprintf_append(char **str, const char *fmt, va_list ap)
{
return ta_vasprintf_append_at(str, str && *str ? strlen(*str) : 0, fmt, ap);
return ta_vasprintf_append_at(str, *str ? strlen(*str) : 0, fmt, ap);
}
/* Append the formatted string at the end of the allocation of *str. It