summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-21 05:12:55 +0100
committerwm4 <wm4@nowhere>2014-11-21 05:18:09 +0100
commit85fb2af369e9ea8638beaf3a34865e3553329a02 (patch)
tree5d73b2ea57a66fc8e9ef33358a4aa89071a2e60f
parent4704fab82c084dbcca52b5e75f7a36877921dbd9 (diff)
downloadmpv-85fb2af369e9ea8638beaf3a34865e3553329a02.tar.bz2
mpv-85fb2af369e9ea8638beaf3a34865e3553329a02.tar.xz
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.
-rw-r--r--player/command.c3
-rw-r--r--player/configfiles.c2
-rw-r--r--player/video.c3
-rw-r--r--ta/ta_utils.c2
4 files changed, 3 insertions, 7 deletions
diff --git a/player/command.c b/player/command.c
index 10a779f638..30768e9b71 100644
--- a/player/command.c
+++ b/player/command.c
@@ -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[] =
diff --git a/player/configfiles.c b/player/configfiles.c
index 75011eb9fa..2d966eb7f7 100644
--- a/player/configfiles.c
+++ b/player/configfiles.c
@@ -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;
diff --git a/player/video.c b/player/video.c
index f74bd4d9f5..506c7971a7 100644
--- a/player/video.c
+++ b/player/video.c
@@ -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;
}
diff --git a/ta/ta_utils.c b/ta/ta_utils.c
index 7c66a14490..80a42bb16d 100644
--- a/ta/ta_utils.c
+++ b/ta/ta_utils.c
@@ -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