summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-01-08 03:45:17 +0100
committerwm4 <wm4@nowhere>2020-01-08 03:45:17 +0100
commitf612de17129054c915c23b18241988a284f0baa5 (patch)
tree0c804feeb6753783a32021fc3746c6fda13e53e8
parent1c83ded3b0be1814ccee61a7f36229bb01e7c1b5 (diff)
downloadmpv-f612de17129054c915c23b18241988a284f0baa5.tar.bz2
mpv-f612de17129054c915c23b18241988a284f0baa5.tar.xz
vo_gpu: fix crash if dither texture fails to allocate
Theoretically possible (and quite unlikely due to the small texture size). The code was originally written with the assumption that texture allocations can't fail, and it was never updated out of laziness. Untested.
-rw-r--r--video/out/gpu/video.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index 3ec5cdfcd9..88a8557cc2 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -2764,6 +2764,9 @@ static void pass_dither(struct gl_video *p)
debug_check_gl(p, "dither setup");
talloc_free(temp);
+
+ if (!p->dither_texture)
+ return;
}
GLSLF("// dithering\n");