summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-11-18 23:30:42 +0100
committerDudemanguy <random342@airmail.cc>2023-11-18 23:55:28 +0000
commit4449f38c17766a4645fda12dc0f56a79f0ae2bce (patch)
tree2362f8cfdbf5391a662734aaf9b6283dce73388d /video
parent9456b2f6e96fbf950324f5d7ad458f504644bb41 (diff)
downloadmpv-4449f38c17766a4645fda12dc0f56a79f0ae2bce.tar.bz2
mpv-4449f38c17766a4645fda12dc0f56a79f0ae2bce.tar.xz
various: add some missing error checks
Diffstat (limited to 'video')
-rw-r--r--video/out/gpu/video.c5
-rw-r--r--video/out/vo_gpu_next.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index 0f48261389..852ee78cde 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -1702,6 +1702,7 @@ static void reinit_scaler(struct gl_video *p, struct scaler *scaler,
double scale_factor,
int sizes[])
{
+ assert(conf);
if (scaler_conf_eq(scaler->conf, *conf) &&
scaler->scale_factor == scale_factor &&
scaler->initialized)
@@ -1709,13 +1710,13 @@ static void reinit_scaler(struct gl_video *p, struct scaler *scaler,
uninit_scaler(p, scaler);
- if (conf && scaler->index == SCALER_DSCALE && (!conf->kernel.name ||
+ if (scaler->index == SCALER_DSCALE && (!conf->kernel.name ||
!conf->kernel.name[0]))
{
conf = &p->opts.scaler[SCALER_SCALE];
}
- if (conf && scaler->index == SCALER_CSCALE && (!conf->kernel.name ||
+ if (scaler->index == SCALER_CSCALE && (!conf->kernel.name ||
!conf->kernel.name[0]))
{
conf = &p->opts.scaler[SCALER_SCALE];
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 440a324031..e003f2391f 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -1946,6 +1946,9 @@ static void update_hook_opts(struct priv *p, char **opts, const char *shaderpath
break;
}
+ if (!opt.type)
+ goto next_hook;
+
opt.type->parse(p->log, &opt, k, v, hp->data);
goto next_hook;
}